题意:从0开始捐款,每次不超过m元,首先达到n元的获胜
思路:等同于从n开始,每次取不超过m,首先达到0的获胜。(Bash Game)
#include<iostream> #include<stdio.h> using namespace std; int main(){ int c,n,m; scanf("%d",&c); while(c--){ scanf("%d%d",&n,&m); if(n%(m+1)!=0)printf("Grass "); else printf("Rabbit "); } return 0; }