Making CV

0

0 votes
Problem

Recluse Janie (RJ) is feeling frustrated. All her friends have done various projects and have a great CV. But RJ doesn't have motivation enough to do a project. So in her boredom, she starts drawing a line on her CV, starting from the top left corner of the page. Every time she reaches an edge, she draws another line starting from there as if the lines she draws represent light being reflected off the edges of the CV. She keeps on drawing until her line reached another corner.
This corner happened to be the top right corner. Surprisingly, the number of line segments she had drawn was her favourite number. She started wondering in how many ways could she have drawn from the top left corner reaching the top right corner in the same number of line segments.
Given her favourite number, give the number of ways it is possible. And then tell Recluse Janie to continue working on a project by outputting "Go do a project, RJ!"

Input format:
First line contains number of testcases t.
Each testcase consists of a single line, containing the width w and height h of the CV and RJ's favourite number f.

Output format:
For each testcase, output two lines. On the first line, output the number of ways the drawing was possible. On the second line, output "Go do a project, RJ!"

Sample Input:
9
3 7 12
4 3 9
3 2 4
2 2 3
1 2 2
10 10 10
13 1 20
14 1 10000
102 103 1234

Sample Output:
6
Go do a project, RJ!
0
Go do a project, RJ!
2
Go do a project, RJ!
0
Go do a project, RJ!
1
Go do a project, RJ!
5
Go do a project, RJ!
6
Go do a project, RJ!
4896
Go do a project, RJ!
432
Go do a project, RJ!

Limits:
t<1000
1<=w,h<=10^5
2<=f<=10^5

Time limit: 5s

Time Limit: 7
Memory Limit: 256
Source Limit:
Editor Image

?