Sunday, April 24, 2016

UVA 11805 - Bafana Bafana : Solution

Unknown
#include <stdio.h>
int main()
{
    int t, c=1,n,k,p;
    scanf("%d",&t);
    while (t--)
    {
        scanf("%d%d%d",&n,&k,&p);
        k=k+p%n;
        if (k>n) k=k-n;
        printf("Case %d: %d\n",c++,k);
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,