/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 1ms 540.0 KiB
#3 Wrong Answer 1ms 540.0 KiB

Code

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

typedef long long ll;
#define bug(a) cout << #a << " : " << a << endl;

ll lc(ll a,ll b){
    return (a/__gcd(a,b))*b;
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1; cin >> t;
    while (t--) {
        ll a,b,c,d,x;cin>>a>>b>>c>>x;
        ll k=lc(a,b);
        k=lc(k,c);
        if(k<x){
            cout<<k<<endl;
        }
        else cout<<-1<<endl;
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1025 GCM
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-07 19:59:54
Judged At
2024-12-07 19:59:54
Judged By
Score
2
Total Time
1ms
Peak Memory
540.0 KiB