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)|
|Languages:||All except: SCM chicken|
Can be done without strings per se
beware of floating pt errors costed me 1WA
good question and must for beginners :)
very gud questn (y)
u have python , u have power !!!
well ...just so that you know ...using double might not be a good idea :P
Shivam kumar :
if avg = 3.3333
any tricky test case?
learnt a new thing..nice problem
nice and easy :) good question :)