Wrong Answer
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