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-01-14 12:27:40
Use basic multiplication, read article on geeksforgeeks for further refrence.
2017-01-07 18:52:38
Basic Multiplication :)
2017-01-03 07:31:39
Beware of :Your solution is too long for this problem, the limit is 2000 bytes! :D
although Ac in 1st attempt :)
2017-01-02 10:31:37
I'm getting correct answer on ideone but here it is showing wrong answer. :(
2017-01-01 16:29:24
You need to solve this problem using basic multiplication.
2016-12-29 19:11:51
I'm using long double and %.0Lf in c. It's working fine on my pc. WA here. Any idea anyone? :/
2016-12-18 17:05:25
will someone please tell me the format of input and output.....tried both ways(displaying all the results at last and displaying it instantly )..but getting WA...
2016-12-02 14:58:20
int cannot store factorial of 100.
this is why its showing wrong answer.
2016-11-27 15:06:30
day#2problem#5

=(Francky)=> Please stop that. Imagine if every one do that !!!

Last edit: 2016-11-27 16:18:31
2016-11-04 18:39:08
using loops instead of arrays is easy :(
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.