#include<bits/stdc++.h>

using namespace std;

int main(){
    int t,j,n;
    long long int x,y,rc,diff;
    double r,total;
    
    cin >> t;
    for(j=1;j<=n;j++){
        cin >>n>>x>>y;
        for(int i=1;i<=n;i++){
            total += i;
        }
        r=total/(x+y);
        rc=r;
        diff=r-rc;
        if(diff > 0){
            cout <<"Case #"<<j<<": IMPOSSIBLE" << endl;
        }
        else{
            cout <<"Case #"<<j<<": POSSIBLE"<< endl;
        }
    }
return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: