Sunday, April 24, 2016

UVA 11723 - Numbering Roads : Solution

Unknown
#include <stdio.h>
int main ()
{
    int r,n,c=1,suffix;
    while (c<=10002)
    {
        scanf("%d%d",&r,&n);
        if(r==0 &&n==0) break;
        if (r>n)
        {
            if ((r-n)%n==0) suffix=(r-n)/n;
            else suffix=((r-n)/n)+1;
        }
        else suffix=0;
        if (suffix>26) printf("Case %d: impossible\n",c++);
        else printf("Case %d: %d\n",c++,suffix);
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,