URI Online Judge | 1483

Animal Game

Por Ricardo Anido Brazil
Timelimit: 1

In a not very distant country, people are addicted on a simple bet game. The game is based in numbers and is called "Animal Game". The game received this name because the numbers are divided in 25 groups, depending of the value of the two last digits (tens and units). Each group is associated with an animal in the following form: the first group (donkey) is formed by the numbers 01, 02, 03 and 04; the second group (eagle) is formed by the numbers 05, 06, 07 and 08; and so on until the last group, formed by the numbers 97, 98, 99 and 00. The rules of he game are simple. In the moment of the bet, the player decides the value of the bet V and a number N (0 ≤ N ≤ 1000000). All the days, in the main square of the city, a number M is drawn (0 ≤ M ≤ 1000000). The prize is calculated as follows:

Input

The input contains several test cases. Each case consists of one line containing a real number V and two integers N and M, representing respectively the amount bet with two decimal places (0.01 ≤ V ≤ 1000.00), the number chosen for the bet (0 ≤ N ≤ 1000000) and the selected number (0 ≤ M ≤ 1000000). The end of input is indicated by a line containing V = M = N = 0.

Output

For each test case your program should print a line containing a real number with two decimal places, representing the prize corresponding to the given bet.

Sample Input Sample Output

32.20 32 213929
10.50 32 213032
2000.00 340000 0
520.00 874675 928567
10.00 1111 578311
0 0 0

515.20
5250.00
6000000.00
0.00
500.00