Concepts2
∑MathAdvanced
Floor Sum Formula
The floor sum computes S(n,m,a,b) = sum_{i=0}^{n-1} floor((a i + b)/m) efficiently in O(log(min(a,m))) time.
#floor sum#atcoder library#euclidean algorithm+12
∑MathIntermediate
GCD and Euclidean Algorithm
The greatest common divisor (gcd) of two integers is the largest integer that divides both without a remainder.
#gcd#euclidean algorithm#extended euclidean+12