/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 532.0 KiB
#2 Wrong Answer 2ms 532.0 KiB

Code

#include<bits/stdc++.h>
#define ll          long long
#define nl          '\n'
#define F           first
#define S           second
#define pb          push_back
#define all(a)      (a.begin()),(a.end())
#define Input       freopen("in.txt","r",stdin)
#define Output      freopen("out.txt","w",stdout)
#define PI          2*acos(0.0)
#define MOD         1000000007
using namespace std;


const int N = 2e5 + 5;

void Solve()
{
    int x, y, k;

    cin >> x >> y;
    for (int i = 1; i <= 100; i++) {
        if (x % i and y % i) {
            cout << i << nl;
            return ;
        }
    }
    cout << "-1\n";
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t, T = 1;
    cin >> T;
    for (t = 1; t <= T; t++)
        Solve();
    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:43:27
Judged At
2026-01-06 14:43:27
Judged By
Score
0
Total Time
2ms
Peak Memory
532.0 KiB