Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int T, N, K, P, i, L;
- cin >> T;
- for(i = 1; i <= T; i++) {
- cin >> N >> K >> P;
- L = (K + P <= N) ? K + P : (K + P) % N;
- L = (!L) ? N : L;
- cout << "Case " << i << ": " << L << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement