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-03-31 06:57:08 B.R.ARVIND
use char array in case of c and string in case of c++.. in java ,can use BigInteger
2012-03-29 16:08:24 chandanapericharla
On checking I found that it works good only till 22!(c lang) from 23!(used double to store the factorial) the zeros are being omitted. I could not make out a what the problem is. Can any one please help me out. Thank you in advance.


Last edit: 2012-03-29 16:10:59
2012-02-29 16:41:20 Vikas Yadav
what name to give to file in java????
2012-02-23 01:23:12 Dario Pavlovic
im really not sure why im getting a wrong answer here, i checked almost all possible solutions with wolfram alpha and still getting wa.

Last edit: 2012-02-23 01:24:30
2011-12-30 12:46:08 Mukund Kumar
i m getting ri8 answr on turbo compiler....hwevr gettin ce on it.....plz help
2011-12-06 22:54:37 Santiago Zubieta
Use BigInteger in Java..
2011-11-08 05:54:10 jayanth kumar
how to store values from 40! to 100!
i am not getting the correct output.
2011-10-04 21:12:22 Dominik
I sent 10 times, tested more than 10 numbers like 0,1,2,3,4,5,10,20,30,50,60,70,80,90,100... All are correct and I'm printing cout << endl; after each (I also tried with printf("\n");... And whole time I'm getting wrong answer T_T, is there some kind of bug?? (programiming in C++) Thx for any reply
2011-10-02 06:51:27 jayesh hathila
i ran a for loop and printed all the test cases from 1 t0 100 but here its giving "nzec".plz help me
2011-09-25 05:32:55 Hitman
I got runtime error NZEC, while uploading my code in python. why??
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.