Penguin Navigator
Time limit1sMemory limit1024 MB
Count the numberings of a 2 by N grid with 1 to 2N such that every right or down move from (1,1) to (2,N) increases the tile number.
- Level
Medium7 of 10
- Topics
- Dynamic programming, Combinatorics, Math, Implementation
- Solved
- No attempts yet
Problem
A penguin is at . The penguin wants to get home. Its home is at . However, someone broke all the ice paths, so it can no longer get home. Hyeonjin will build ice paths for the penguins. The ice path is in size, and each ice tile can be numbered from to with no repeats. These penguins have a peculiar habit. A penguin moves only right or down from its current position. However, the number of the tile it moves to must be greater than the number of the tile it came from. Write a program to find the number of ice paths that let a penguin reach home no matter how it moves.
Input
The first line gives the horizontal length of the ice path ().
Output
On the first line, print the number of ice paths modulo .