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
2011-04-19 09:25:18 ziaur rahman
I am also getting WA, using C++ , any advice?
2011-03-19 19:56:21 MF
The only way is to create a minimal arbitrary-size arithmetic functions in order to handle such great outputs ( unless your language supported ASA ). Think about it: 1<=n<=100
15! = 1307674368000
Can your integers hold such a value?
How about 20! ? 30! ? 40! ? 100! ? I hope you get my point.

Last edit: 2011-03-19 20:00:26
2011-03-17 09:45:07 Nenu Anda Roxana
I am getting WA but my program works on my machine. How to handle the output???
2011-02-22 21:06:55 Qianli Ma
Should not allow python3 for this problem...
2011-02-07 20:03:21 sayed khalaf sayed
Why WA?? i have right outputs. please how to handle the output..
2011-02-07 19:35:45 Ahmed Atif Salah
I have WA, i got bored from WA, plz sombedy tell me how to handle the inputs and outputs, my problem with WA is in all the problem i try to solve while i have right outputs...
2011-01-30 14:20:06 vikesh
I am getting correct answer for every test case on my machine but on submission WA is coming. Could anyone guide me in the right direction. values that i have checked are - 1,2.....,15,71,100.......correct result for all of them. Thanks in advance :)
2011-01-25 19:50:15 Prajeeth
Any tips for solving this using C++ ?
Source limit is kinda harsh for me
2011-01-23 21:56:23 Gustavo Souto H.Campelo(GEO SUL - PB)
Well...i'm still doing this program and i'm using vector
2011-01-10 23:29:58 Michal
Calculations are for ... But the code limit is not for tables...

Last edit: 2011-01-10 23:34:45
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.