(以下、long long に修正後のソース)
int gcd ( int a, int b ) { if(a<b) { int tmp=a; a=b; b=tmp; } int c; while ( a != 0 ) { c = a; a = b%a; b = c; } return b; } int main() { int T; cin>>T; //cout<<T<<endl; REP(t, T) { int ans = 1; int pd, pg, d=100, g=100, v; ll n; cin>>n>>pd>>pg; //cout<<n<<pd<<pg; v = gcd(d, pd); pd/=v; d/=v; v = gcd(g, pg); pg/=v; g/=v; //cout<<pd<<" "<<d<<" "<<pg<<" "<<g<<" "<<endl; //if(g<d) //{ // int a=d/g + 1; // g*=a; pg*=a; //} if((pd!=d&&pg==g)||(pd>0&&pg==0) || d>n) { cout<<"Case #"<<t+1<<": Broken"<<endl;; continue; } //cout<<pd<<" "<<d<<" "<<pg<<" "<<g<<" "<<endl; cout<<"Case #"<<t+1<<": Possible"<<endl;; } return 0; }