ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > Epoka Science Olympiad 2013-2015 > задача:


2014-11Gr-10. 50430 - ATM

Epoka Science Olympiad 2013-2015

Старт: 18.мая.2013 в 10:00:00
Финиш: 18.мая.2013 в 15:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 2013-11Gr-10. 50314 - Falling Distance
• 2013-11Gr-20. 50315 - Pig Latin
• 2013-11Gr-30. 50316 - Population B...
• 2013-11Gr-40. 50317 - Student Line Up
• 2014-10Gr-10. 50424 - Area
• 2014-10Gr-20. 50417 - Fun Fair
• 2014-10Gr-30. 50418 - Student ave...
• 2014-10Gr-40. 50429 - Secret Message
• 2014-11Gr-10. 50430 - ATM
• 2014-11Gr-20. 50420 - Teachers Si...
• 2014-11Gr-30. 50431 - Sultan's Game
• 2015-09Gr-10. 50344 - Profit or Loss
• 2015-09Gr-20. 50725 - Fibonacci Se...
• 2015-09Gr-30. 50302 - Paper Sciss...
• 2015-09Gr-40. 50303 - Pattern
• 2015-10Gr-10. 50308 - IT Knowledg...
• 2015-10Gr-40. 50322 - Snake Pattern

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Halil Karimis.

ATM

Question: Ardit would like to withdraw X $US from an ATM. The cash machine will only accept the transaction if X is a multiple of 5, and Ardit's account balance has enough cash to perform the withdrawal transaction (including bank charges). For each successful withdrawal the bank charges 0.50 $US. Calculate Ardit's account balance after an attempted transaction.

Input specification
Positive integer X (0 < X ≤ 2000) - the amount of cash which Ardit wishes to withdraw.
Nonnegative number Y (0 ≤ Y ≤ 2000) - Ardit's initial account balance.

Output specification
Output the account balance after the attempted transaction, given as a number with two digits of precision. If there is not enough money in the account to complete the transaction or X is not a multiple of 5, output the current bank balance.

 Sample Input I     Sample Input II     Sample Input III   
 30 90.56789
 42 120.00
 300 120.00
 Sample Output I     Sample Output II     Sample Output III   
 60.07
 120.00
 120.00

Explanation:

  1. Regular transaction
  2. The amount to withdraw is not a multiple of 5
  3. The amount to withdraw is greater than the amount he has in the account

Для отправки решений необходимо выполнить вход.

www.contester.ru