## Fast Factorial Calculator 2

View as PDF

Points: 30 (partial)
Time limit: 1.0s
Memory limit: 64M
Author:

Problem type

d is not in a good mood today, so he has decided to torment people. He wants you to write a large factorial calculator. More specifically, he wants you to calculate very very very large factorials. He wishes you luck.

#### Input Specification

The first line of input contains the integer , , the number of cases to follow.

The next lines will contain an integer , such that , whose factorial you are to calculate.

#### Output Specification

For every integer , you are to output .

#### Sample Input

2
5
13

#### Sample Output

120
1932053509

• Beautiful_Times  commented on Nov. 12, 2017, 2:33 p.m.

Any hints on how to optimize the code, other than methods that were used in the first question

• BonyBen  commented on Nov. 13, 2017, 1:20 a.m.

No

• moladan123  commented on Nov. 2, 2016, 3:11 p.m.
Yay

Good job d, you just turned a comment into a problem ;)

• elm224  commented on Nov. 2, 2016, 12:11 a.m.
oops

For the sample output, wouldn't 13 factorial be 6227020800 or am I misunderstanding the question?

• nathanl3  commented on Nov. 2, 2016, 7:47 a.m.

For every integer , you are to output (mod )