Pyramid
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
We write in the number of numbers from 1 to N (in the example N = 4).
1 2 3 4
Now under him write out the number of (N – 1) numbers, each of which is the product of two numbers that are above it:
1 2 3 4
2 6 12
Continue to prescribe the ranks, yet there will be a single number:
1 2 3 4
2 6 12
12 72
864
The result was an inverted pyramid on top of which number 864.
Input
In the first line of input data is the number of N (2 <= N <= 50).
Output
Remove the first digit of the bottom of the pyramid with the base of the N numbers.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 9%