#include using namespace std; using ll = long long; #include using namespace atcoder; using mint = modint998244353; vector S; ll calc(ll x){ int N=S.size(); stack P; for(int i=0;i>Q>>Y; S.resize(Q); for(int i=0;i>S[i]; ll L=-1,R=Y+1; while(R-L>1){ ll M=(R+L)/2; if(calc(M)>=Y)R=M; else L=M; } if(calc(R)==Y)cout<>T; // while(T--) solve(); }