Pascal's Triangle

Replay of First Step Cont...
Limits 1s, 512 MB

Given an integer N, print the sum of the Nth row of the Pascal's triangle.

In mathematics, Pascal's triangle is a triangular array of the binomial coefficients. Below are the first few rows of the Pascal's triangle:

                    1
                1       1
            1       2       1
        1       3       3      1
    1       4       6      4      1
1       5      10      10      5      1

The numbers on the edges of the triangle are always 1. Each of the remaining numbers are the sum of the two numbers that appear immediately above it.

The sum of the 5th row, for example, is $ 1 + 4 + 6 + 4 + 1 = 16 $.

Input

The input will contain one integer N (0 < N < 30).

Output

Print the sum of the Nth row of Pascal's triangle.

Sample

InputOutput
5
16

Submit

Login to submit.

Contributors

Statistics

97% Solution Ratio
nurbijoyEarliest, Nov '18
nurbijoyFastest, 0.0s
ReduancsLightest, 0 B
saitotaShortest, 16B
Toph uses cookies. By continuing you agree to our Cookie Policy.