题解:P13365 [GCJ 2011 #1A] FreeCell Statistics
Mayuteng20121224 · · 题解
题目传送门
这道题就是一道简单的 if 题,算得上是黄题里很简单的一道题了!
当
当
当
当
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll gcd(ll a, ll b)//求最大公约数
{
if(b==0)return a;
return gcd(b,a%b);
}
ll T;
int main(){
cin>>T;
for(ll i=1;i<=T;i++)
{
ll n,PD,PG;
cin>>n>>PD>>PG;
string s="Broken";
//判断
if(PG==100)
{
if(PD==100)s="Possible";
}
else if(PG==0)
{
if(PD==0)s="Possible";
}
else if(PD==0||PD==100)s="Possible";
else
{
ll d=100/gcd(PD,100);
if(d<=n)s="Possible";
}
cout<<"Case #"<<i<<": "<<s<<"\n";//输出
}
return 0;
}