#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> N; ll a = N/2; ll b = N-a; a %= mod; b %= mod; ll unit = b+1; ll c = unit * a + b; c %= mod; p(c); return 0; }