画图游戏
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 613 Accepted Submission(s): 190
Problem Description
forever97和pikapikachu在玩一种画图游戏,两人相互往一个n*m大的矩形里画半径为r的圆,任意两圆不能相交,圆与矩形也不能相交,不能再画的人输。现在forever97先画,假设两人都足够聪明,均采取最佳策略,问最后谁会赢?
Input
第一行一个正整数T(T<=100),表示共有T组数据。
对于每组数据,一行三个正整数n,m,r(1<=n,m,r<=10000)。
对于每组数据,一行三个正整数n,m,r(1<=n,m,r<=10000)。
Output
对每组数据输出一行,即最后的赢家。
Sample Input
2 2 2 1 1 1 1
Sample Output
forever97. pikapikachu>.<先手能画一个圆,就必赢#include <iostream> #include <string.h> #include <math.h> #include <stdio.h> #include <algorithm> #include <stdlib.h> using namespace std; typedef long long int LL; int n,m,r; int main() { int t; scanf("%d",&t); while(t--) { scanf("%d%d%d",&n,&m,&r); if(n>=2*r&&m>=2*r) printf("forever97. "); else printf("pikapikachu>.< "); } return 0; }