GAMES  HOW MANY GAMES
Problem Statement:
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 nonnegative 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.
Input Constraints:
1<=t<=1000
1<=avg<=1000000 (maximum 4 digits after the decimal place)
Example:
Sample Input:
3
5
5.5
30.25
Sample Output:
1
2
4
hide comments
anuj0503:
20160612 18:43:00
Take input as character string, convert to integer + gcd !!! AC :) 

the_darkknight:
20160526 17:10:57
Last edit: 20160526 17:49:35 

aspro:
20160526 07:36:55
good ques...those getting WA work on these test cases...


kanishkajoshi:
20160328 22:19:52
what will be output for 3.33


Pikachu:
20160315 07:46:38
@fly_sky12 It'll be 10000 

fly_sky12:
20160312 12:48:44
if input is 3.3333


minhthai:
20160107 10:32:02
nice problem (plz don't use double...) 

gomathi ganesan:
20151223 06:51:31
Nice problem... :)


sarangs:
20151220 13:12:46
learned about double precision


Prakhar Dev Gupta:
20151210 03:45:18
AC in a GO! 
Added by:  cegprakash 
Date:  20121012 
Time limit:  0.185s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 