FCTRL2 - Small factorials


You are asked to calculate factorials of some small positive integers.

Input

An integer t, 1 ≤ t ≤ 100, denoting the number of testcases, followed by t lines, each containing a single integer n, 1 ≤ n ≤ 100.

Output

For each integer n given at input, display a line with the value of n!

Example

Input:
4
1
2
5
3

Output:
1
2
120
6

hide comments
`Ak: 2014-08-05 14:35:33

@Adrian Kosowski Weak Running Judge!!
If we do 0! = 0 It gives AC!!
and we know that 0! = 1.....

Last edit: 2014-08-05 14:36:15
Deepanshu Thakur: 2014-07-30 20:37:00

even this is giving me wrong result
<snip>

Last edit: 2022-09-17 23:07:44
MAHENDER REDDY: 2014-07-30 20:33:06

@hunter return 0 from main ..

Deepanshu Thakur: 2014-07-30 20:12:22

WA why it is correct <snip>

Last edit: 2022-09-17 23:07:40
Ketan Gupta: 2014-07-28 19:43:02

@Shaurya Dwivedi
You need to think of a data structure that stores so long factorials. You cannot use long long.

Shaurya: 2014-07-25 21:02:16

time limit exceeded.
Any guesses wHAT to do in c to make it more efficient?

[Lakshman]: 2014-07-25 19:00:32

@rahulpasunuri Do you think your code will work for 30? No it will not.

rahulpasunuri: 2014-07-25 13:30:50

can any one tell me.. whats wrong with my code?
<snip>

Last edit: 2022-09-17 23:07:35
arun vinud: 2014-07-20 22:38:06

@Hunter Compile it in ideone.com and see whether it goes through also check for n=100

Hunter: 2014-07-19 16:19:36

help me m...getting the NZec for every submission...help plzzz


Added by:adrian
Date:2004-05-28
Time limit:1s
Source limit:2000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All