#include #include using namespace std; using ll = long long int; using pll = pair; // #include // using namespace atcoder; #define REP(i, a, b) for (ll i = (a); i < (b); i++) #define REPrev(i, a, b) for (ll i = (a); i >= (b); i--) #define ALL(coll) (coll).begin(), (coll).end() #define SIZE(v) ((ll)((v).size())) #define REPOUT(i, a, b, exp, sep) REP(i, (a), (b)) cout << (exp) << (i + 1 == (b) ? "" : (sep)); cout << "\n" // @@ !! LIM(mod) // ---- inserted library file algOp.cc // Common definitions // zero, one, inverse template constexpr T zero(const T& t) { if constexpr (is_integral_v || is_floating_point_v) { return (T)0; } else { return t.zero(); } } template constexpr T one(const T& t) { if constexpr (is_integral_v || is_floating_point_v) { return (T)1; } else { return t.one(); } } template constexpr T inverse(const T& t) { if constexpr (is_floating_point_v) { return 1.0 / t; } else { return t.inverse(); } } // begin -- detection ideom // cf. https://blog.tartanllama.xyz/detection-idiom/ namespace detail { template