luckYrat's library.

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


:warning: cpp/math/gcd-lcm.cpp

Required by

Code

template <typename T>
T gcd(T a,T b){
  if(a%b==0)return b;
  else return gcd(b,a%b);
}
template <typename T>
T lcm(T a,T b){
  return a/gcd(a,b)*b;
}

#line 1 "cpp/math/gcd-lcm.cpp"
template <typename T>
T gcd(T a,T b){
  if(a%b==0)return b;
  else return gcd(b,a%b);
}
template <typename T>
T lcm(T a,T b){
  return a/gcd(a,b)*b;
}

Back to top page