teamnote default

This commit is contained in:
2026-06-03 09:20:51 +09:00
commit f50ed902fe
65 changed files with 6033 additions and 0 deletions

7
source/Math/FloorSum.cpp Normal file
View File

@@ -0,0 +1,7 @@
ll floor_sum(ll a, ll b, ll c, ll n)
{
if(a == 0) return b/c*n;
if(a>=c or b>=c) return n*(n-1)/2 * (a/c) + n * (b/c) + floor_sum(a%c, b%c, c, n);
ll m = (a*(n-1)+b)/c;
return m*n - floor_sum(c, c-b+a-1, a, m);
}