mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
22 lines
334 B
C++
22 lines
334 B
C++
|
#include<stdio.h>
|
||
|
long long a,b;
|
||
|
long long up(long long a,long long b)
|
||
|
{
|
||
|
long long t;
|
||
|
if(a==0) return b;
|
||
|
while(b!=0)
|
||
|
{
|
||
|
t=b;b=a%b;a=t;
|
||
|
}
|
||
|
return a;
|
||
|
}
|
||
|
int main()
|
||
|
{
|
||
|
while(scanf("%lld%lld",&a,&b)!=EOF)
|
||
|
{
|
||
|
if(a==0&&b==0) break;
|
||
|
printf("%lld\n",a*b/up(a,b)/up(a,b));
|
||
|
}
|
||
|
return 0;
|
||
|
}
|