#include<iostream> #include<set> using namespace std; typedef long long LL; const int N = 10000010,MOD = 998244353; LL n,m,a[N],p[N]; set<int> pos,zr; LL go(int st,int l,int r) { LL ans = (l == st ? 1ll : 2ll) * a[st],pos = st; while(pos + 1 <= r && pos - st <= 30) { ...