// UVa 11805 - Bafana Bafana #include <iostream> using namespace std; int main() { int tt; cin >> tt; for (int t = 1; t <= tt; t++) { int n, k, p; cin >> n >> k >> p; int last = (k + p) % n; if (last == 0) last = n; cout << "Case " << t << ": " << last << endl; } return 0; }
No comments:
Post a Comment