Social Icons

Thursday, November 26, 2015

Solve of UVA 11723: Numbering Roads

Solve of UVA 11723: Numbering Roads


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b,c,e=1;
    double d;
    while(cin>>a>>b && a!=0 &&b!=0)
    {
        if(b>=a) cout<<"Case "<<e<<": "<<0<<endl;
        else if(a>b && (a-b)<=b*26) { d=a-b;cout<<"Case "<<e<<": "<<ceil((float)d/b)<<endl;}
        else cout<<"Case "<<e<<": "<<"impossible"<<endl;
        e++;
    }
    return 0;
}

No comments:

Post a Comment

 

Sample text

Sample Text

 
Blogger Templates