|
|||||||||||||||||||
|
SPOJ time: 2012-05-26 13:53:20 |
ATMProblem code: HS08TEST
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 €. InputPositive 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. OutputOutput the account balance after the attempted transaction, given as a number with two digits of precision. Example1Input: 30 120.00 Output: 89.50 Example2Input: 300 120.00 Output: 120.00 ScoringThis 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.
|
||||||||||||||||||
| |||||||||||||||||||