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
2012-08-31 08:28:09 Luke Johnston
I'm assuming that we can't added libraries. I tried submit with "using System.Numerics" using c# and it said Compilation error. Took it out and it went up a level to Wrong answer.

Last edit: 2012-08-31 10:34:07
2012-08-24 23:21:57 Chris Nastovski
Fun fun..

Last edit: 2012-08-27 20:37:44
2012-08-21 13:57:05 mbrc
93326215443944152681699238856266700490715968264381621468592963
89521759999322991560894146397615651828625369792082722375825118
5210916864000000000000000000000000=100!

Last edit: 2012-08-21 13:57:47
2012-08-03 21:57:43 Gyorgy Deak
The string can store it...
2012-07-30 22:09:31 Asha Tulsyan
which data type to store 100!
2012-07-22 09:44:12 i_am_what_i_am
can someone with accepted code post the value of 100 factorial cuz i want to cross check if mine is correct
2012-07-05 12:26:41 wahdan
whats wrong with this code ?
<snip>
plz i need help

Last edit: 2022-09-17 23:07:31
2012-07-01 09:08:07 StupidGuy
Finally...Finally AC! :)
2012-06-23 14:13:23 Derlys Daniel Alvarado Mendoza[UCLA-ve]
I tested all the cases and it works but it says "wrong answer" I need help
my email: <Snip>

Last edit: 2023-06-18 20:58:22
2012-06-22 13:08:24 Kirtika Ruchandani
Python math.factorial() is fast enough - that makes this problem trivial.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.