Problems
10121 - Haltree Kaltree
SUBMIT PROBLEM

Haltree Kaltree

Time Limit: 1 sec

 

The Problem

Once upon a time there was a strange country. And in that country there were two strange trees. One named Haltree and the other named Kaltree.

 

When a Haltree is planted, 1 leaf appears after 1 day, 2 new leaves appear after 2 days, 3 new leaves appear after 3 days and so on. On the other hand, if a Haltree and Kaltree are planted on the same day, then the Kaltree will grow new leaves each day, the number of new leaves growing on the Kaltree each day is equal to the total number of leaves of the Haltree on that day. After every 5 days, the Haltree sheds 5 leaves and the Kaltree   sheds 10 leaves.

 

Nihad went to that strange country and planted a Haltree and a Kaltree. After ‘n’ days he came back and now he wants to know how many leaves the Haltree and Kaltree currently has. As counting leaves is a tiresome task, he asked you, as his programmer friend, to calculate the number of leaves on each tree after a given number of days.

 

The Input

Nihad will frequently come to visit and ask you the number of leaves. So, there will be multiple test cases. Test cases can be indicated by an integer T, (0<T<=40). And in the next T lines, there will be the number of days (n) as input (0<n<=100).

 

The Output

For each input n, print a single line “H, K.” here H total number of leaves of the Haltree and K total number of leaves of the Kaltree after n days. For a clear understanding some sample inputs and outputs are given below.

 

Sample Input

4

1

2

4

6

 

Sample Output

1, 1.

3, 4.

10, 20.

16, 36.

 

 

[University Level]

Inter School & College Programming Contest (ISCPC) 2017

Problem Setter: Asma-ul-Hosna Chowdhury