We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e2b258 commit 4201196Copy full SHA for 4201196
atcoder/math.hpp
@@ -82,7 +82,7 @@ std::pair<long long, long long> crt(const std::vector<long long>& r,
82
long long floor_sum(long long n, long long m, long long a, long long b) {
83
long long ans = 0;
84
if (a >= m) {
85
- ans += (n - 1) * n * (a / m) / 2;
+ ans += (n - 1) * n / 2 * (a / m);
86
a %= m;
87
}
88
if (b >= m) {
0 commit comments