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
2011-07-09 07:11:03 Ying Sihao
You should use ExtEnded.
I hope you can succeed.
2011-07-05 14:41:11 luca tavernari
i'm using a long double but it seams not to be enough, what should i do ?
2011-06-30 17:59:58 Viraj Kulkarni
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!
2011-06-12 13:46:51 Matej Badin
:( Toogle editor shows wrong number of characters, overflow with 1900 characters
2011-06-06 01:45:24 shivaraj Challapalli
In my terminal im getting the answer accurately but here it is given as wrong answer ????
2011-05-13 12:55:23 Piotr KÄ…kol
@Albert Gevorgyan - Check all factorials 1..100 on Wolfram Alpha or ask on forum.
2011-05-13 05:14:12 albertg
I'm getting the same answer(9332621544394415268169923885626670049071596826438162146859296389521759999322991560 8941463976156518286253697920827223758251185210916864000000000000000000000000 ) for 100, but /i getting WA. HELP!!!
2011-05-13 04:08:42 albertg
Thank you, ycxw.
2011-04-30 14:21:13 Sarwesh Shah
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
2011-04-30 13:22:00 anonymous
100! = 9332621544394415268169923885626670049071596826438162146859296389521759999322991560 8941463976156518286253697920827223758251185210916864000000000000000000000000
Just in case someone wants to check :)

Last edit: 2011-04-30 13:22:44
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.