7/26/2013

11805 - Bafana Bafana - UVA

  1. #include<iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5.         int testCases , N , K , P , position;
  6.        
  7.         cin>>testCases;
  8.        
  9.         for(int i = 0 ; i<testCases ; i++)
  10.         {
  11.                 cin>>N>>K>>P;
  12.                 position = K + P;
  13.                 while(position  > N)
  14.                 {
  15.                         position-=N;
  16.                 }
  17.                 cout<<"Case "<<i+1<<": "<<position<<endl;
  18.         }
  19.         return 0;
  20. }


    You can find more of my solutions on
     Here

No comments:

Post a Comment