Busy Programmer

Our famous programmer Gordov Mia (Mr. Donkey) is having a very busy time in his office. His erratic boss has assigned him to two projects (project MICRO and project GOO) at the same time. Consequently, problems have occurred while making a feasible work schedule for him. The boss needs to submit a report to the CEO specifying the schedule of work for all the resources working under him for a period of 2D days. Gordov must work D days on each project. He doesnt work more than a single project on a particular day. Gordov must finish the work of the project he started earlier (i.e. on the first day of the schedule) first. As the progress of both the projects depends on him, he can not be away from any project for more than G consecutive days. (of course unless a project is already complete.) For example, if D = 3 and G = 2, there can be ten valid schedules, Day 1 1 MICRO 2 GOO 3 MICRO 4 GOO 5 MICRO 6 GOO 7 MICRO 8 GOO 9 MICRO 10 GOO Day 2 MICRO GOO MICRO GOO GOO MICRO GOO MICRO GOO MICRO Day 3 GOO MICRO GOO MICRO MICRO GOO MICRO GOO GOO MICRO Day 4 MICRO GOO GOO MICRO MICRO GOO GOO MICRO MICRO GOO Day 5 GOO MICRO MICRO GOO GOO MICRO MICRO GOO MICRO GOO Day 6 GOO MICRO GOO MICRO GOO MICRO GOO MICRO GOO MICRO Now, Given D and G, you are to determine the number of straints. Input There are around 2400 test cases in the input file. Every test and G (D, G ≤ 33) on a line by itself. A case with D = G = −1 terminates the input. This case must not be processed. Output For each test case, print a line in the format ‘Case x: y’ where x is the case number and y is the number of possible schedules. Sample Input 32 31 -1 -1 Sample Output Case 1: 10 Case 2: 2 possible schedules with the given con- case has two non-negative integers, D