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

Sample input:
4
1
2
5
3

Sample 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
2014-07-30 20:37:00 Deepanshu Thakur
even this is giving me wrong result
<snip>

Last edit: 2022-09-17 23:07:44
2014-07-30 20:33:06 MAHENDER REDDY
@hunter return 0 from main ..
2014-07-30 20:12:22 Deepanshu Thakur
WA why it is correct <snip>


Last edit: 2022-09-17 23:07:40
2014-07-28 19:43:02 Ketan Gupta
@Shaurya Dwivedi
You need to think of a data structure that stores so long factorials. You cannot use long long.
2014-07-25 21:02:16 Shaurya
time limit exceeded.
Any guesses wHAT to do in c to make it more efficient?
2014-07-25 19:00:32 [Lakshman]
@rahulpasunuri Do you think your code will work for 30? No it will not.
2014-07-25 13:30:50 rahulpasunuri
can any one tell me.. whats wrong with my code?
<snip>

Last edit: 2022-09-17 23:07:35
2014-07-20 22:38:06 arun vinud
@Hunter Compile it in ideone.com and see whether it goes through also check for n=100
2014-07-19 16:19:36 Hunter
help me m...getting the NZec for every submission...help plzzz
2014-07-18 19:33:46 Michael Moerschell
9 lines of Python code... :) -> 0.12s

Last edit: 2014-07-18 19:34:18
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.