1 solutions

  • 0
    @ 2025-12-3 8:44:14

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    long long a,b,c,a1,b1;
    int main()
    {
    //	freopen("1017.in","r",stdin);
    //	freopen("1017.out","w",stdout);	
    	cin>>a>>b;
    	a1=a,b1=b;
    	c=a%b;
    	while(c!=0)
    	{
    		a=b;
    		b=c;
    		c=a%b;
    	} 
    	cout<<a1*b1/b;;
    	return 0;
    }
    
    • 1

    Information

    ID
    780
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By