NPS-INR-Cyber-Programming-2021

The 2021 edition of the NPS Indiranagar interhouse Cyber Programming contest.

View on GitHub

Jack Ma’s New Hobby

Problem Statement:

Sitting in a Chinese prison for a misunderstanding, Jack Ma developed a hobby of dominoes art. While putting together, arguably the best domino art the prison had seen, he began to wonder… What if I had an infinite supply of 1 × 2 and 2 × 1 dominoes and had to fill an N × 2 grid? For example, Jack can fill a 2 × 2 grid using 2 1 × 2 dominoes or 2 2 × 1 dominoes. Find the total number of ways Jack can fill an N × 2 grid using only 1 × 2 and 2 × 1 dominoes.

Constraints:

Subtask 1: 10 points

Subtask 1: 10 points

Subtask 1: 10 points

Input Format:

Output Format:

Sample input:

3 

Sample output:

3