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
2016-07-03 21:33:11
seriouly.........100! comes under small factorials
2016-06-30 16:15:09
newline sucks !!
2016-06-26 20:23:18
JAVA 0.11 Oh Yeahhhhh. and for java users calculation in only main class no extra classes
2016-06-02 13:25:15
showing wrong answer only because i had'nt put a newline after answer,though giving right answer

=(Francky)=> You can use newline, or space, but 1 2 120 6 and 121206 are different answers... you need to separate answers.

Last edit: 2016-06-02 13:32:05
2016-06-01 07:27:23
used array & got AC. coz u won't be able to solve 100! without arrays. 0.00

Last edit: 2016-06-01 08:24:15
2016-05-31 10:37:56
Source limit = 2000B !?
Couldnt include my custom IO functions
Anyway used BufferedReader & BigInteger and got it in 0.09
(Dont forget 100! is huuuuuugggggggeeeeee !!)

Last edit: 2016-05-31 10:39:34
2016-05-24 04:09:41
learned something new by doing it in c
2016-05-21 09:28:16
double data type in c++ gives the correct answer why is it giving wa?
2016-05-18 15:08:38
giving wa although my code is correct
can somebody help
2016-05-15 00:10:07
Low hanging fruit with Java's BigInteger... =)
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.