Advertisement
Farjana_akter

Untitled

Jan 25th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int t,n,p,i,j,k,a;
  7. cin>>t;
  8. for(j=1;j<=t;j++)
  9. {
  10. cin>>n>>k>>p;
  11. while(p--)
  12. {
  13. k++;
  14. if(k>n)
  15. k=1;
  16. }
  17. cout<<"Case "<<j<<":"<<" "<<k<<endl;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement