Pyramid#246

Pyramid

1 წამი
64 მეგაბაიტი
საშუალო

Let us write the numbers from to in a row (for example, if N = 4):

Below this row, write another row of (N - 1) numbers, where each number is the product of the two numbers directly above it:

Continue this process, writing new rows, each time decreasing the length by one, until only one number remains:

In this way, we obtain an inverted pyramid, with at the vertex.

შემავალი მონაცემები

The first line contains the integer (2 \leq N \leq 50).

გამომავალი მონაცემები

Output the first digit of the bottommost number of the pyramid whose base consists of numbers.

მაგალითები

მაგალითი 1

Loading
Loading