#include #include #include using namespace std; using ll=long long; const ll LNF=1e18; const int INF = 1e9+1; const ll M = 1e9+7; typedef pair P; struct mat { vector> v, v2; vector an, an2; int n; mat(int _n) : n(_n) { v.resize(n); for(int i=0;i0) { if (x&1) update_ans(); update(); x>>=1; } } void print() { for(int i=0;i>m>>k; mat ma(m); ma.initialize(); //ma.print(); ma.solve(k); //ma.print(); cout<