/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB

Code

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

void solve()
{
    int a,b,c,x; cin>>a>>b>>c>>x;
   int m= lcm(a,lcm(b,c));
   if(m<x){
       cout<<m<<endl;
   }
   else{
       cout<<-1<<endl;
   }
}

int main()
{
    int t; cin>>t;
    while(t--) solve();
}

Information

Submit By
Type
Pretest
Problem
P1025 GCM
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-03 14:40:38
Judged At
2024-11-11 02:51:23
Judged By
Score
10
Total Time
1ms
Peak Memory
324.0 KiB