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 / no. 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.
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.
For each test case, find the minimum number of matches the player should have played to achieve that average.
1<=avg<=1000000 (maximum 4 digits after the decimal place)
|Cluster:||Cube (Intel Pentium G860 3GHz)|
Why is this giving a wrong answer? I have checked all the testcases I could come across, and it seems to be working fine.
WA using input as double
ac in 2 nd go .just
Sandeep N Menon:
python giving TLE
to avoid floating point errors use int and char...
Solved it using strings.
why is using double giving WA??
can anyone give me few boundary cases. Giving me WA but all answers for boundary cases mentioned in comments are matching :(
Can be done without strings per se