#include "bits/stdc++.h" using namespace std; #define DEBUG(x) cout<<#x<<": "< #define vl vector #define vii vector< vector > #define vll vector< vector > #define vs vector #define pii pair #define pis pair #define psi pair const int inf = 1000000001; const ll INF = 1e16; #define MOD 1000000007 #define mod 1000000009 #define pi 3.14159265358979323846 #define Sp(p) cout<> n; if (n % 2) { cout << ((((n*n) - 1) / 4) % M + n % M) % M << endl; } else { cout << (((n*n) / 4) % M + n % M) % M << endl; } }