GAMES - How Many Games?

no tags 

A player has played unknown number of games. We know the average score of the player (sum of scores in all the games / number 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.

Constraints

1 <= t <= 1000
1 <= average <= 1000000 (maximum 4 digits after the decimal place)

Example

Input:
3
5
5.5
30.25

Output:
1
2
4

hide comments
L: 2013-07-11 13:20:56

!!! same code gives tle and ac !! weird..

Himanshu: 2013-06-21 12:28:15

Ah! AC :) enjoy solving! nice problem

Himanshu: 2013-06-21 12:27:10

easy problem. a silly mistake cause me 1 WA and 1 TLE

Last edit: 2013-06-21 12:29:20
Mayank Manish: 2013-05-29 10:23:37

I am getting the correct answer but my time limit has exceeded. i'm using break statement in my code. any suggestion to rectify???

Chandan Mittal: 2013-05-27 21:57:59

what will be the correct o/p for
0.3332
and
0.3334

Rajarshi Sarkar: 2013-04-28 08:55:47

Nice one :)

Arika Saputro: 2013-04-25 09:10:18

be careful convert double to integer in c++ ;D

:-): 2013-04-21 10:48:10

nice problem

Eduardo Nunes: 2013-04-19 00:13:37

nice one, AC without even using any float variables :-D
for 10.3345 answer is 2000 ;-)

Ramanjaneyulu Nallagonda: 2013-04-12 11:47:41

what is ans for 10.3345?


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