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

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

hide comments
2015-08-17 13:26:32
how to handle large numbers in c++??
2015-08-14 06:46:42 shantanu tripathi
this is very easy in c++ ... @frankitox
2015-08-04 05:23:09
This problem It's only interesting only for languages that don't automatically handle big numbers. I tried to do it in C, but didn't work out how to print the number. Then I change to Ruby, and it take only a couple of lines.
2015-07-29 10:08:16
For WA people: the tester checks for 0! even though this shouldn't happen by the problem statement, and only accepts the WRONG answer 0!=0.
2015-07-22 19:43:49
just use string and :D 0.00s no algo nothing used
2015-07-03 12:52:48 chin
My 50th!!...:D
2015-07-01 13:58:28 BadeMeow
Please check my submissions don't know why I am getting a WA.
All the values are correct even compared the O/P file with an accepted solution's O/P file.
Help please!
2015-06-23 19:44:58 Vars
easy after learning java..
2015-06-08 22:15:54
This problem will be extremely easy, if u code in python.
2015-05-29 19:03:59
Can i use gmp lib from c language?
Which libs can i use?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.