画图游戏

画图游戏

                                                                             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)。
 

Output
对每组数据输出一行,即最后的赢家。
 

Sample Input
2 2 2 1 1 1 1
 

Sample Output
forever97. pikapikachu>.<
 

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <climits>
#include <bitset>

using namespace std;

#define LL long long
const int INF=0x3f3f3f3f;

int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        double a,b,c;
        scanf("%lf %lf %lf",&a,&b,&c);
        c*=2;
        a=min(a,b);
        int cnt=0;
        if(a>=c)
        {
            cnt++;
            a-=c;
            a/=2;
        }
        while(1)
        {
            if(a<c)break;
            cnt+=2;
            a-=c;
            a/=2;
        }
        if(cnt%2)printf("forever97.\n");
        else printf("pikapikachu>.<\n");
    }
    return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值