#include <iostream>
using namespace std;
int nwd(int a, int b)
{
int r;
while (b!=0)
{
r=a%b;
a=b;
b=r;
}
return a;
}
int nww(int a, int b)
{
return a*b/nwd(a,b);
}
int main() {
int a=20, b=12;
cout << nwd(a,b) << endl;
cout << nww(a,b) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG53ZChpbnQgYSwgaW50IGIpCnsKCWludCByOwoJd2hpbGUgKGIhPTApCgl7CgkJcj1hJWI7CgkJYT1iOwoJCWI9cjsKCX0KCQoJcmV0dXJuIGE7Cn0KCmludCBud3coaW50IGEsIGludCBiKQp7CglyZXR1cm4gYSpiL253ZChhLGIpOwp9CgppbnQgbWFpbigpIHsKCWludCBhPTIwLCBiPTEyOwoJCgljb3V0IDw8IG53ZChhLGIpIDw8IGVuZGw7Cgljb3V0IDw8IG53dyhhLGIpIDw8IGVuZGw7CglyZXR1cm4gMDsKfQ==