/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 2ms 532.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    #ifdef SUBLIME
        freopen("inputf.in", "r", stdin);
        freopen("outputf.out", "w", stdout);
        freopen("error.txt", "w", stderr);
    #endif

    int tt;
    cin >> tt;
    while (tt--) {
        int a, b;
        cin >> a >> b;
        int ans = -1;
        for (int k = 1; k <= 100;k++) {
            if (k % a != 0 && k % b != 0) {
                ans = k;
                break;
            }
        }
        cout << ans << "\n";
    }
    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:53:47
Judged At
2026-01-06 14:53:48
Judged By
Score
100
Total Time
2ms
Peak Memory
532.0 KiB