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
appy: 2014-01-16 17:32:04

is dere a whitespaces before the output and the input ????........i m gettng WA fr a simple question

amit_gh: 2014-01-05 21:30:32

my answer is taking more than 2000bytes. How to overcome that

Aakash Chandrasekaran: 2013-12-29 09:19:12

nice problem :)

Denys: 2013-12-27 08:51:38

I've checked results of my program with table of factorials - everything looks good for all possible inputs (0<=n<=100), for example for 100! = 93326215...000000000. It looks like an error in test cases, please can anybody check tests?

Last edit: 2013-12-27 13:14:58
Abhishek Sharma: 2013-12-24 17:50:12

"wrong answer" is displayed,despite running correctly on my terminal.
What could be possible error?

Jinal : 2013-12-09 06:33:03

My code is perfectly correct..works right on ideone, bt still shows "wrong answer" here....pls someone help.....

Shivam Dimri: 2013-12-08 07:45:10

it depends which language you are choosing to code this problem, java is very helpful as it allows user to handle big integer calculations and manipulations easily whereas in c++ you need to store big integers in form of array of digits.

Abhishek Tyagi: 2013-12-01 23:04:54

Have you guys tried the program for values >21??

Last edit: 2013-12-01 23:05:03
Rahul Jain: 2013-11-09 09:33:48

after n=34, 0 gets printed ..WHY??

Stalcone: 2013-11-08 04:10:35

@Pratham Pandey, that's impossible due to condition: 1<=n<=100.

Last edit: 2013-11-08 04:10:59

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