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-12-08 02:30:05
in C you need to build a function that work with int* from 0 to 9 to represent the 100! (which have more than 158 decimal places)

Last edit: 2017-12-08 15:25:14
2017-11-26 22:15:03
how to reduce source code to 2000B in c?
2017-11-16 02:25:25
use boost in c++
2017-10-29 09:13:18
when i implement the code in python it is easy but when using c, even an long long unsigned int can not hold the number, what do i use to implement the code in c?
2017-10-20 20:16:39
AC in single attempt :) NICE ONE
2017-10-15 12:27:57
my code runs perfectly on my computer but it shows wrong answer on spoj.

Last edit: 2017-10-15 12:28:15
2017-10-05 20:23:02
on ideone all output is correct but why spoj is showing wrong ??
2017-09-28 18:54:03
I just submitted the solution in java but it shows compilation error,when I ideon it only shows the scala programming
2017-09-16 13:37:13
Very interesting problem implement using array or use bigintegers
2017-08-25 08:19:11
on ideone all output is correct but why spoj is showing wrong ??
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.