CPLibrary

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub o06660o/CPLibrary

:warning: src/math/i128gcd.hpp

Code

i128 gcd(i128 a, i128 b) {
  while (b != 0) {
    i128 t = b;
    b = a % b;
    a = t;
  }
  return a;
}
i128 lcm(i128 a, i128 b) { return a / gcd(a, b) * b; }
#line 1 "src/math/i128gcd.hpp"
i128 gcd(i128 a, i128 b) {
  while (b != 0) {
    i128 t = b;
    b = a % b;
    a = t;
  }
  return a;
}
i128 lcm(i128 a, i128 b) { return a / gcd(a, b) * b; }
Back to top page