HS08TEST - ATM
Julia would like to withdraw X € from an ATM. The cash machine will only accept the transaction if X is a multiple of 5, and Julia's account balance is sufficient to perform the withdrawal transaction (including bank charges). Calculate Julia's account balance after an attempted transaction, if you know that for an accepted transaction the bank makes a charge of 0.50 €.
Positive integer 0 < X <= 2000 - the amount of cash which Julia wishes to withdraw.
Nonnegative number 0<= Y <= 2000 with two digits of precision - Julia's initial account balance.
Output the account balance after the attempted transaction, given as a number with two digits of precision.
Input: 30 120.00 Output: 89.50
Input: 300 120.00 Output: 120.00
This is a test problem and you will receive no points for solving it. However, at 12:00 on Saturday, September 27, we will give out small gifts to some users, drawn from among those registered contestants who have solved this problem in more programming languages available at SPOJ then all other registered contestants. See the "prizes" tab for more details. Note: the special contest is over now.
|Cluster:||Cube (Intel G860)|
|Languages:||ADA95 ASM32 BASH BF C CSHARP CPP C99 CLPS LISP sbcl LISP clisp D FORTRAN HASK ICON ICK JAVA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCM qobi SCM guile ST WHITESPACE|
|Resource:||SPOJ High School Programming League 2008/2009|