Code
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int N = 1000005;
int z, x, y, a, i;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> z;
while(z--) {
cin >> x >> y;
a = -1;
for (i=1;i<=100;i++) if (i % x != 0 && i % y != 0) a = i;
cout << a << endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1235 A. Valid Integer
- Contest
- Happy New Year 2026
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2026-01-06 14:32:21
- Judged At
- 2026-01-06 14:32:21
- Judged By
- Score
- 100
- Total Time
- 4ms
- Peak Memory
- 532.0 KiB