Uva 12114 Solution

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n, m, i = 1;
    while(cin >> n >> m && n != 0 && m != 0)
    {
        ll c = 1;
        cout << "Case " << i++ << ": ";
        if(n-1 == 0)
        {
            cout << ":-\\" << endl;
            continue;
        }
        ll d = (m-1)/(n-1);
        if(d < c)
            cout << ":-(" << endl;
        if(d >= c)
            cout << ":-|" << endl;
    }
    return 0;
}

Comments