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

test/yosupo/math/min_linear.test.cpp

AC · 最終更新 2026-07-24 · GitHub

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

依存するヘッダ(1)
実装
// competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/min_of_mod_of_linear
#include <iostream>
#include "number_theory/min_linear.hpp"

int main() {
    int t;
    std::cin >> t;
    while (t--) {
        int n, m, a, b;
        std::cin >> n >> m >> a >> b;
        std::cout << min_linear(n, m, a, b) << '\n';
    }

    return 0;
}