题解:手动模拟一下就行
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#define ll long long
using namespace std;
ll n,m,k,x,ans;
ll fastpow(ll a,ll p) {
ll ans=1;a%=n;
for(;p;p>>=1,a=(a*a)%n)
if(p&1) ans=(ans*a)%n;
return ans;
}
int main() {