algo — C++23 日本語リファレンス GitHub

test/yosupo/math/floor_sum.test.cpp

AC · 最終更新 2026-09-06 · GitHub

問題: https://judge.yosupo.jp/problem/sum_of_floor_of_linear

依存するヘッダ(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;
}