Problems
10160 - Propagate Sansevieria
SUBMIT PROBLEM

Propagate Sansevieria

Time Limit: 1 sec

 

The Problem

Sansevieria is a great air purifier plants  according to NASA, native to Africa, Madagascar and southern Asia. It has quite a few common names so you may know them as Snake Plants, Mother In Law Tongue, Snake’s Tongue, Bowstring Hemp Plant and Devil’s Tongue. Whatever you choose to call it, just know that they’re so very easy to propagate.

 

I love this plat so much that’s why this year (2019) I bought one Sansevieria plant from nursery and place the plant in a pot in my bed room. Seller told me that, this plant propagate 2 child plants every year after 4 years of age of this plant and all child plant do the same. So I am trying to calculate how many plant I will have after certain years.

 

First year I have 1 plant, second year have 1 plant, third year have 1 plants, fourth year have 3 plants but after that I am not able to calculate how many plant I have. Can you please calculate how many plat I have at five year, six year and so on.

 

The Input

There are several lines of input, and each line contains a positive integer y (0 < y <= 50) which is the year number. Input is terminated by EOF.

 

The Output

For each line of input you have to print how many Sansevieria plant I have in that year in a seperate line.

 

Sample Input

2

4

 

Sample Output

1

3

 

 

 

Inter University Programming Contest - Summer 2019 [BGC Trust University Bangladesh]

Problem Setter: Shahin ShamS