Odd Length Factorial Sequence

0

0 votes
Medium
Problem

Paul doesn’t like numbers with even length (we define the length of a number as the number of digits of the number), but he is wondering if he can create the odd length factorial sequence (OLFS). This sequence works in the following way: given a positive integer N, the of N is the length of the factorial with odd length.

These are the first 10 OLFS:

N 0 1 2 3 4 5 6 7 8 9

OLFS 1 1 1 1 3 3 5 7 9 11

Explanation: for the numbers 0, 1, 2, 3, 5, 6, 8, 10, 12, 14 we have their respective factorials 1, 1, 2, 6, 120, 720, 40320, 3628800, 479001600, 87178291200.

Can you help our friend Paul to solve this task?

Input

The first line contains T() the number of test cases. The next T lines contains an integer N (), for which you should provide value of .

Output

In the next T lines, print the calculated value .

Sample Input
10
0
1
2
3
5
10
15
20
25
100
Sample Output
1
1
1
1
3
13
29
41
57
323
Time Limit: 1.5
Memory Limit: 32
Source Limit:
Explanation

None

Contributers:
Editor Image

?