ll gcd(ll x, ll y) {
while (y) {
ll tmp = y;
y = x % y;
x = tmp;
}
return x;
}
ll lcm(ll x, ll y) {
return x * y / gcd(x, y);
}
최대 공약수로 나눈 ----하면 간단한 분모
y = y / gcd(x, y);
ll gcd(ll x, ll y) {
while (y) {
ll tmp = y;
y = x % y;
x = tmp;
}
return x;
}
ll lcm(ll x, ll y) {
return x * y / gcd(x, y);
}
최대 공약수로 나눈 ----하면 간단한 분모
y = y / gcd(x, y);