今天看到一个简洁的写法,感觉很舒服,分享一下。
ll gcd(ll x, ll y){ return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y){ return (x / gcd(x, y))*y;
}