In memory of the compatriots who died in the 512 Wenchuan earthquake - selecting volunteers (Bash game)

Problem Description
For the disasters suffered by compatriots in Sichuan, people all over the country have extended a helping hand. Almost every province and city has sent a large number of rescuers, including the armed police force for rescue and disaster relief, medical staff for treatment and epidemic prevention, and psychological counseling. Psychologist. According to the requirements, our school also has a quota for disaster relief in the disaster area. Due to the active registration of teachers and students, the school has to make selections to decide the final candidate. After several rounds of assessment, the situation has gradually become clear, and the final quota will be created between "Team Lin" and "Team Xu". But it was a coincidence that the resumes of the two people were almost identical, which made 8600, who presided over the selection, very embarrassed. Helpless, he decided to decide who can be selected through donations.
The selection rules are as follows:
1. The initial donation box is empty;
2. Two people take turns to donate, the amount of each donation must be a positive integer, and each donation per person must not exceed m yuan (1<=m<=10) .
3. The first party whose total donation amount reaches or exceeds n yuan (0<n<10000) is the winner, and then it can go to the disaster area to serve in person.
We know that both of them want to be included in the volunteer list, and they are both very smart people. Assuming that Team Lin donates first, please judge who can be selected for the final list?
 

Input
The input data first contains a positive integer C, indicating that it contains C groups of test cases, and then C lines of data, each line contains two positive integers n, m, n and m. Refer to the rules mentioned above for the meaning.
 

Output
For each set of test data, if Team Lin can be selected, please output the string "Grass", and if Team Xu can be selected, please output the string "Rabbit". The output of each instance occupies one line.
 

Sample Input
 
  
28 1011 10
 

Sample Output
 
  
GrassRabbit

naked bash game

Direct code:

#include <stdio.h>
#include <iostream>
using namespace std;
intmain()
{
	int c , n , m ;
	scanf("%d" , &c);
	while(c--)
	{
		scanf("%d %d" , &n , &m);
		int flag = n %(m+1);
		if(flag == 0)
		{
			printf("Rabbit\n");
		}
		else
		{
			printf("Grass\n");
		}
	}
	return 0;
 }


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326718006&siteId=291194637