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
2014-11-27 21:44:39 Nick C
My code prints out correctly for every number between 1 and 100. Not sure what the error could be.
2014-11-27 02:25:23 Minsuk Kim
very straightforward with python 2.7 - can use recursion to define function. Managed to write two solutions - one with 15 lines the other with only 7 lines
2014-11-04 08:03:22 Devesh Thakur
Nice problem...learnt to deal with large no's
2014-10-30 19:48:10 Prakhar Dev Gupta
Is there some problem with the code??
I am getting WA despite it is not and verified on ideone. The output meets the demand of the question
2014-10-22 11:15:42 Abhay Jain
i seriously don't understand what's wrong with my code.i've tried the code even with the given sample input and it does give the exact sample output!!!
2014-10-10 15:07:14 Wasim Thabraze
@Shivam and @Ankit Please don't post the code here! Utilise forum.
2014-08-17 10:46:09 Akshay Kamthan
Learnt something new and interesting!
Good problem!
2014-08-13 15:12:54 Mohit Bora
can anyone whats wrong in this code
<snip>

Last edit: 2022-09-17 23:07:58
2014-08-13 09:00:03 Rohit Jain
Can anyone tell me..what is wrong with this code. I wrote it in C#
<snip>

Last edit: 2022-09-17 23:07:54
2014-08-12 12:16:07 prashant
Can someone tell me what is wrong with this code
<snip>

Last edit: 2022-09-17 23:07:51
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.