#include #include #include #include #include #include using namespace std; #define FOR(i, n, m) for(int i = n; i <= m; i++) #define REP(i, n, m) for(int i = n; i >= m; i--) #define PB push_back #define MP make_pair typedef long long ll; typedef unsigned long long ull; typedef pair PII; const int maxn = 100010; const ll mod = 9973; ll inv[mod+10]; ll inv_pre[maxn], pre[maxn]; ll Fast_Multi(ll a, ll k, ll mod){ ll ans = 1; while(k > 0){ if(k&1) ans = ans * a % mod; k >>= 1; a = a * a % mod; } return ans % mod; } void Preprocess(){ FOR(i, 1, mod-1) inv[i] = Fast_Multi(i, mod-2, mod); //FOR(i, 1, 10){cout<