提交时间:2024-01-21 15:24:56
运行 ID: 121123
#include <iostream> #include <algorithm> #include <cstdio> #include <cmath> #include <queue> using namespace std; const int MAXN = 1e3 + 1e2; queue <int> m; queue <int> f; int x, y, k; int main() { scanf("%d %d %d", &x, &y, &k); for (int i = 1;i <= x;i++) m.push(i); for (int i = 1;i <= y;i++) f.push(i); int tx, ty; for (int i = 1;i <= k - 1;i++) { tx = m.front(); ty = f.front(); m.pop(); f.pop(); m.push(tx); f.push(ty); } tx = m.front(); ty = f.front(); m.pop(); f.pop(); printf("%d %d\n", tx, ty); return 0; }