4 solutions

  • 0
    @ 2025-2-22 20:04:41
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    int a,b,c,x,y;
    cin>>x>>y;
    a=x;
    b=y;
    while(a%b!=0)
    {
    	c=a%b;
    	a=b;
    	b=c;
     } 
     cout<<x*y/b<<" "<<b;
    	return 0;
    }
    

    Information

    ID
    2155
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    1
    Tags
    # Submissions
    49
    Accepted
    26
    Uploaded By