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
Devesh Aggrawal:
20151008 21:55:42
Boundary conditions...getting 1st TLE and then wrong answer.... 

Kriti Singhal:
20150925 13:09:21
why the hell is it giving WA using double????


anandrohit:
20150907 22:03:32
Is the Solution is possible without String ? 

Dhruv Mullick:
20150812 22:15:41
@xpshekhar, 10000. 

xpshekhar:
20150805 14:30:37
what if the user input is 3.3333.


kshitij_kohli:
20150724 02:23:03
Why is this giving a wrong answer? I have checked all the testcases I could come across, and it seems to be working fine.


ASHUTOSH DWIVEDI:
20150711 21:15:50
WA using input as double


karthik1997:
20150707 20:00:11
ac in 2 nd go .just [spoiler removed] Last edit: 20150810 20:56:10 

Sandeep N Menon:
20150623 17:49:40
python giving TLE 

Bhuvnesh Jain:
20150613 16:19:21
to avoid floating point errors use int and char...

Added by:  cegprakash 
Date:  20121012 
Time limit:  0.185s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel Pentium G860 3GHz) 
Languages:  All 