/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Runtime Error 1ms 532.0 KiB
#2 Runtime Error 1ms 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;
        if (a == 1 || b == 1) cout << -1 << "\n";
        else cout << (a * b) / __gcd(a, b) << "\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:49:51
Judged At
2026-01-06 14:49:51
Judged By
Score
0
Total Time
1ms
Peak Memory
532.0 KiB