test/yosupo/math/floor_sum.test.cpp
依存するヘッダ(1)
-
floor sum
lib/number_theory/floor_sum.hpp
実装
// competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/sum_of_floor_of_linear
#include <iostream>
#include "number_theory/floor_sum.hpp"
int main(void) {
int t;
std::cin >> t;
while (t--) {
int n, m, a, b;
std::cin >> n >> m >> a >> b;
std::cout << floor_sum(n, m, a, b) << '\n';
}
return 0;
}