Numbers of Interest
Practice
3.3 (14 votes)
Basic programming
Mathematics
Open
Approved
Easy
Mathamatics
Problem
22% Success 12991 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Harold always boasted about his prowess with numbers. So one day Reese challenged him to a problem. He gave Harold two numbers X and Y and asked him to find out the Nth number of the series which began with X numbers of Y’s and the following elements are equal to the sum of the last X numbers in the series. Help Harold find the Nth number of the series.

Input:
The first line contains a number T , number of test cases.
The next T lines each contain 3 integers X, Y and N separated by single space.

Output:
For each test case print the Nth number of the sequence.

Constraints:
1<=T<=10^6
0 < N <= 50
0 < X < 50
0 <= Y< 3

Problem statement in native language : http://hck.re/F91Yaz

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
2 votes
Tags:
ImplementationMathematicsEasyMathematicsMathamatics
Points:20
16 votes
Tags:
Basic ProgrammingOpenApprovedEasyMathamatics
Points:20
17 votes
Tags:
EasyBasic MathMathematicsMathematics