# 悼念512汶川大地震遇难同胞——选拔志愿者

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 11716    Accepted Submission(s): 7537

Problem Description

1、最初的捐款箱是空的；
2、两人轮流捐款，每次捐款额必须为正整数，并且每人每次捐款最多不超过m元(1<=m<=10)。
3、最先使得总捐款额达到或者超过n元（0<n<10000）的一方为胜者，则其可以亲赴灾区服务。

Input

Output

Sample Input

2
8 10
11 10

Sample OutputGrass Rabbit

Author

lcy

Source

2008-06-18《 ACM程序设计》期末考试——四川加油！中国加油！

Recommend

lcy   |   We have carefully selected several similar problems for you:  1848 1847 2187 1404 1517

AC代码

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>
#include <set>
#include <utility>
using namespace std;
typedef long long ll;
#define inf 0x3f3f3f3f
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define lep(i,l,r) for(int i=l;i>=r;i--)
#define ms(arr) memset(arr,0,sizeof(arr))
//priority_queue<int,vector<int> ,greater<int> >q;
const int maxn = (int)1e5 + 5;
const ll mod = 1e9+7;
int main()
{
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
ios::sync_with_stdio(0),cin.tie(0);
int num;
cin>>num;
while(num--)
{
int n,m;
cin>>n>>m;
if(m>=n)
cout<<"Grass"<<endl;
else if(n%(m+1)!=0)
cout<<"Grass"<<endl;
else
cout<<"Rabbit"<<endl;
}
return 0;
}