MONEYYTU - Save money for YTU

It is Taru’s dream to study in Yanyang Technological University and Taru must start saving money in order to ensure that he has sufficient funds to take admission. Taru needs to have X amount of dollars at the end of T months. Taru deposits his money in a bank that pays a monthly interest of R% on the balance in his account. But wait, Taru is very superstitious; he deposits money in his account only if the balance in the account is a multiple of 100. If the balance in the account at the beginning of a month is not a multiple of 100 Taru withdraws the minimum offset to make the balance divisible by 100 and donates it to a charitable trust. Example – If in the beginning of the month Taru has $17823 in his account he will donate $23 and make the balance divisible by 100. You are to calculate the minimum monthly installment which Taru should deposit in the bank in order to get the funds required.

Input

The first line contains the number of test cases (Test) followed by Test lines each containing 3 integers, X, T, R.

Output

For each test case output the minimum monthly installment Taru deposits in the bank in order to generate the required funds. Print the answer rounded to 4 decimal places.

Constraints Test<=20, X<=10^6, T<=60, R<=10.

Sample Input

2

50000 3 5

20000 5 6

Sample Output

15142.8571

3386.7925

 


Added by:Saransh Bansal
Date:2012-03-21
Time limit:0.100s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2017-05-23 10:14:12 hanstan
Think simply :D
and AC in one go!

Last edit: 2017-05-23 10:17:15
2012-03-29 23:23:14 Palash Jain
Also, could you please check this submission 6751223. I am getting WA.
2012-03-29 21:59:49 Palash Jain
Does he/she give donation after last month also? If so, what happens in the case where x=50020, do we need to accumulate 50100 ?

Last edit: 2012-03-29 22:00:02
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.