GAMES - How Many Games?
A player has played unknown number of games. We know the average score of the player (sum of scores in all the games / number of games). Find the minimum number of games the player should have played to achieve that average.
The player can score any non-negative integer score in a game.
Input
The first line consists of an integer t, the number of test cases. Each test case consists of a single rational number which represents the average score of the player.
Output
For each test case, find the minimum number of matches the player should have played to achieve that average.
Constraints
1 <= t <= 1000
1 <= average <= 1000000 (maximum 4 digits after the decimal place)
Example
Input: 3 5 5.5 30.25 Output: 1 2 4
hide comments
nikoo28:
2012-11-10 11:28:00
got AC... :) Last edit: 2012-11-11 14:08:48 |
|
aristofanis:
2012-11-09 19:43:53
Can you give me some tricky test-cases? I can't understand why I'm getting WA. |
|
Ahmed AKram:
2012-11-02 00:55:31
finally AC, nice problem ! |
|
Aniket Kumar:
2012-10-26 19:34:02
@Aditya Pande ,very true ;had to do a lot of experiments with my code.Finally got AC , what a relief. Last edit: 2012-10-26 19:35:46 |
|
Aditya Pande:
2012-10-24 17:42:07
really learned something from this problem |
|
Ehor Nechiporenko:
2012-10-22 08:58:58
One more test for guys:
|
|
Aaquib Khwaja:
2012-10-21 17:58:12
More test cases please.. |
|
Vaishali Behl:
2012-10-20 09:36:23
Could someone please provide some more test cases?I don't understand why I am getting a WA. Last edit: 2012-10-21 05:22:33 |
|
Ehor Nechiporenko:
2012-10-19 09:29:59
Easy nice problem |
|
Pranay:
2012-10-18 19:04:34
simple but nice logic :) Last edit: 2012-10-19 02:53:15 |
Added by: | cegprakash |
Date: | 2012-10-12 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |