لینکهای مفید برای شرکت در مسابقه:
در طول مسابقه، میتوانید سؤالات خود را از قسمت «سؤال بپرسید» مطرح کنید.
Minions have been on this planet far longer than we have. They're all different. But they all share the same goal. To serve the most despicable master they could find. After thousands of rough years, finally they found the most despicable master in the world, “Erfan.aa”. They are very happy so they’re having a celebration. After dancing, singing and all of those “heavy rejections”, the time for lunch has come. The great Minion “Sir Kevin” is very creative. He and other minions form a grid waiting for Erfan to bring them bananas. The grid is shown in the following picture. Each circle indicates a cell.
Erfan has bananas. He will start from a cell on the grid and give a banana to the Minion on that cell and go to another cell, give another banana to the Minion on the new cell and so on... until he runs out of bananas. His movement among cells must obey the following rules:
Example:
If Erfan is on the cell and The minion on the cell is fed, he can move to the following cells:
Erfan is very curious. He wants to know how many ways exist to do this task. He’s now busy in the celebration, Can you help him?
The first line of input shows the number of test cases .
Each of following lines contains two space separated integers and indicating start cell and number of bananas respectively.
For each test case, print a single line Case#<caseNumber> : <#PossibleWays>
. For more
clarifications see Sample Output.
In the first test case:
There are ways to do the task: .