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

hide comments
Nick C: 2014-11-27 21:44:39

My code prints out correctly for every number between 1 and 100. Not sure what the error could be.

Minsuk Kim: 2014-11-27 02:25:23

very straightforward with python 2.7 - can use recursion to define function. Managed to write two solutions - one with 15 lines the other with only 7 lines

Devesh Thakur: 2014-11-04 08:03:22

Nice problem...learnt to deal with large no's

Prakhar Dev Gupta: 2014-10-30 19:48:10

Is there some problem with the code??
I am getting WA despite it is not and verified on ideone. The output meets the demand of the question

Abhay Jain: 2014-10-22 11:15:42

i seriously don't understand what's wrong with my code.i've tried the code even with the given sample input and it does give the exact sample output!!!

Wasim Thabraze: 2014-10-10 15:07:14

@Shivam and @Ankit Please don't post the code here! Utilise forum.

Akshay Kamthan: 2014-08-17 10:46:09

Learnt something new and interesting!
Good problem!

Mohit Bora: 2014-08-13 15:12:54

can anyone whats wrong in this code
<snip>

Last edit: 2022-09-17 23:07:58
Rohit Jain: 2014-08-13 09:00:03

Can anyone tell me..what is wrong with this code. I wrote it in C#
<snip>

Last edit: 2022-09-17 23:07:54
prashant: 2014-08-12 12:16:07

Can someone tell me what is wrong with this code
<snip>

Last edit: 2022-09-17 23:07:51

Added by:adrian
Date:2004-05-28
Time limit:1s
Source limit:2000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All