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
2017-03-15 05:23:07
<Don't post any source code here. >

Last edit: 2017-03-15 05:30:04
2017-03-13 16:42:23
use bigIntegers in java.........cakewalk

Last edit: 2017-03-13 16:42:48
2017-03-07 08:35:10
not working yar
please help big int in compulsory if i will do it in other way then
2017-03-04 21:19:42
my code is right as i have tried to run on other platform but here shows wrong ans. what can i do? it also not show what wrong..
2017-02-24 21:38:01
Python 3.5 can be used without breaking the time limit.
2017-02-20 05:17:48
I'm getting correct answer at ideone but here it shows segmentation fault. Can anyone help me with the reason.
2017-02-16 11:29:26
Any other solution other than biginteger class?
2017-02-15 14:33:57
thanks akhil9093, biginteger class helped, Cheers
2017-02-05 19:07:59
not that simple but my ac in one go ....but use biginteger class..that would really help..!!!otherwise best of luck
2017-01-18 13:39:11
I'm getting SIGSEGV error. Can anyone help me as to what could be the reason?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.