int query() { int n = readInt(); int k = readInt();
int pre = 0; while (true) { int cur = max(0, k / n - pre); if (cur == 0) break; k += cur; pre += cur; } cout << k << endl; return 0;
}