Submit | All submissions | Best solutions | Back to list |
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
Added by: | cegprakash |
Date: | 2012-10-12 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
hide comments
|
||||||||||||||
2019-06-02 16:42:36
Was not working with double so I tried with string and BAAM ,....got accepted |
||||||||||||||
2019-01-23 14:35:50
Remember that the input is a rational number which means [spoiler] Last edit: 2019-05-02 09:47:37 |
||||||||||||||
2018-11-03 22:38:48
hi |
||||||||||||||
2018-11-02 17:55:44
Why can't we think like [spoiler] will be the answer?? Last edit: 2019-01-05 12:27:32 |
||||||||||||||
2018-07-08 15:48:37
do it by getting input in a string...dont use double...dunno why its giving WA |
||||||||||||||
2018-06-28 09:56:55
Spent an hour wondering why 2.3333 won't pass :(. Later read comments and found out :( |
||||||||||||||
2018-02-06 12:16:11
dont give up on this question very easy start with the very basic of [spoiler] Last edit: 2018-08-22 16:05:04 |
||||||||||||||
2017-07-05 05:27:50
Dont use double use string for input ;even though ur answer is correct using double. |
||||||||||||||
2017-06-23 10:19:22
got AC in one go in 0 sec.. Store number in string than extract decimal number from it. Just CHECK how you can [spoiler] Last edit: 2017-08-02 12:58:01 |
||||||||||||||
2017-06-14 16:13:01
basic maths..just handling double is tricky....got ac using [spoiler] Last edit: 2017-08-02 12:58:20 |