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
Ying Sihao: 2011-07-09 07:11:03

You should use ExtEnded.
I hope you can succeed.

luca tavernari: 2011-07-05 14:41:11

i'm using a long double but it seams not to be enough, what should i do ?

Viraj Kulkarni: 2011-06-30 17:59:58

This was silly! I kept getting a wrong answer even though I checked my code and my answers multiple times. I had missed the '\n' at the end of my answer in printf!

Matej Badin: 2011-06-12 13:46:51

:( Toogle editor shows wrong number of characters, overflow with 1900 characters

shivaraj Challapalli: 2011-06-06 01:45:24

In my terminal im getting the answer accurately but here it is given as wrong answer ????

Piotr KÄ…kol: 2011-05-13 12:55:23

@Albert Gevorgyan - Check all factorials 1..100 on Wolfram Alpha or ask on forum.

albertg: 2011-05-13 05:14:12

I'm getting the same answer(9332621544394415268169923885626670049071596826438162146859296389521759999322991560 8941463976156518286253697920827223758251185210916864000000000000000000000000 ) for 100, but /i getting WA. HELP!!!

albertg: 2011-05-13 04:08:42

Thank you, ycxw.

Sarwesh Shah: 2011-04-30 14:21:13

how to increase the digits of precision in the answer? i get precise digits upto 16 places. HELP!!

Last edit: 2011-04-30 14:22:24
anonymous: 2011-04-30 13:22:00

100! = 9332621544394415268169923885626670049071596826438162146859296389521759999322991560 8941463976156518286253697920827223758251185210916864000000000000000000000000
Just in case someone wants to check :)

Last edit: 2011-04-30 13:22:44

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