GAMES - HOW MANY GAMES

no tags 

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 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.

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
kanishkajoshi: 2016-03-28 22:19:52

what will be output for 3.33

Pikachu: 2016-03-15 07:46:38

@fly_sky12 It'll be 10000

fly_sky12: 2016-03-12 12:48:44

if input is 3.3333
output is 3 or 10000

minhthai: 2016-01-07 10:32:02

nice problem (plz don't use double...)

gomathi ganesan: 2015-12-23 06:51:31

Nice problem... :-)
Learnt many stuff......

sarangs: 2015-12-20 13:12:46

learned about double precision

Prakhar Dev Gupta: 2015-12-10 03:45:18

AC in a GO!

RADHE SHYAM LODHI: 2015-10-31 16:13:53

100th !

Devesh Aggrawal: 2015-10-08 21:55:42

Boundary conditions...getting 1st TLE and then wrong answer....

Kriti Singhal: 2015-09-25 13:09:21

why the hell is it giving WA using double????


Added by:cegprakash
Date:2012-10-12
Time limit:0.185s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All