// ____ __ __ _ ___ _ _
// /\ _`\ __ /\ \ /\ \ /' \ /'___`\ /' \ /' \
// \ \ \L\ \/\_\ ___\ \ \___ __ _ __ \_\ \/\_, \ /\_\ /\ \ /\_, \/\_, \
// \ \ , /\/\ \ /'___\ \ _ `\ /'__`\ /\`'__\/'_` \/_/\ \\/_/// /__\/_/\ \/_/\ \
// \ \ \\ \\ \ \/\ \__/\ \ \ \ \/\ \L\.\_\ \ \//\ \L\ \ \ \ \ // /_\ \ \ \ \ \ \ \
// \ \_\ \_\ \_\ \____\\ \_\ \_\ \__/.\_\\ \_\\ \___,_\ \ \_\/\______/ \ \_\ \ \_\
// \/_/\/ /\/_/\/____/ \/_/\/_/\/__/\/_/ \/_/ \/__,_ / \/_/\/_____/ \/_/ \/_/
/**************************************************
* Fast Algorithm Template by Richard1211.
* Please submit with C++14 or higher version.
* Blog on Luogu: https://www.luogu.com.cn/blog/522539/
* Blog on Byethost: http://Richard1211.byethost5.com/
* Blog on RBTree's: https://Richard1211.rbtr.ee/
***************************************************/
//#pragma GCC optimize(3,"Ofast","inline")
//#pragma GCC target("avx2")
//open Ofast sometimes
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
//#include <bits/extc++.h>
#else
//#include <ext/rope>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/hash_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//#include <ext/pb_ds/priority_queue.hpp>
#endif
//#ifdef __linux__
//#include <sys/mman.h>
//#include <sys/types.h>
//#include <fcntl.h>
//#include <unistd.h>
//#else
//#endif
using namespace std;
//using namespace __gnu_cxx;
//using namespace __gnu_pbds;
#define YES io.writeln("YES")
#define Yes io.writeln("Yes")
#define yes io.writeln("yes")
#define NO io.writeln("NO")
#define No io.writeln("No")
#define no io.writeln("no")
#define Poss io.writeln("Possible")
#define poss io.writeln("possible")
#define Impo io.writeln("Impossible")
#define impo io.writeln("impossible")
#define Alice io.writeln("Alice")
#define Bob io.writeln("Bob")
#define Taka io.writeln("Takahashi")
#define Aoki io.writeln("Aoki")
#define PFir io.writeln("First")
#define Pfir io.writeln("first")
#define PSec io.writeln("Second")
#define Psec io.writeln("second")
#define RYES return YES,0
#define RYes return Yes,0
#define Ryes return yes,0
#define RNO return NO,0
#define RNo return No,0
#define Rno return no,0
#define RPoss return Poss,0
#define Rposs return poss,0
#define RImpo return Impo,0
#define Rimpo return impo,0
#define RAlice return Alice,0
#define RTaka return Taka,0
#define RAoki return Aoki,0
#define RBob return Bob,0
#define RFir return PFir,0
#define Rfir return Pfir,0
#define RSec return PSec,0
#define Rsec return Psec,0
#define pf emplace_front
#define pb emplace_back
#define ep emplace
#define ppb pop_back
#define ppf pop_front
#define gp make_pair
#define gt make_tuple
#define fr first
#define sd second
#define elif else if
#define PCase(i) (io.write("Case #"),wrt(i),io.write(": "),0)
#define sc(x) static_cast<long long>(x)
#define scu(x) static_cast<unsigned>(x)
#define scU(x) static_cast<unsigned long long>(x)
#define scd(x) static_cast<double>(x)
#define scD(x) static_cast<long double>(x)
#define scr(x) static_cast<char>(x)
#define sci(x) static_cast<int>(x)
#define GMX(T) numeric_limits<T>::max()
#define GMN(T) numeric_limits<T>::min()
#define GIN(T) numeric_limits<T>::infinity()
#define GES(T) numeric_limits<T>::epsilon()
#define ALL1(G) G.begin(),G.end()
#define ALL2(G,x) G.begin()+x,G.end()
#define ALL3(G,x,y) G.begin()+x,G.begin()+y
#define RALL1(G) G.rbegin(),G.rend()
#define RALL2(G,x) G.rbegin()+x,G.rend()
#define RALL3(G,x,y) G.rbegin()+x,G.rbegin()+y
#define ALLA(G,x,y) G+x,G+y+1
#define SIZ(G) sc(G.size())
#define SOR(...) sort(ALL(__VA_ARGS__))
#define REV(...) reverse(ALL(__VA_ARGS__))
#define MIN(...) *min_element(ALL(__VA_ARGS__))
#define MAX(...) *max_element(ALL(__VA_ARGS__))
#define SUM(T,...) accumulate(ALL(__VA_ARGS__),static_cast<T>(0))
#define LB(x,...) lower_bound(ALL(__VA_ARGS__),x)
#define UB(x,...) upper_bound(ALL(__VA_ARGS__),x)
#define LBG(x,...) lower_bound(ALL(__VA_ARGS__),x,greater{})
#define UBG(x,...) upper_bound(ALL(__VA_ARGS__),x,greater{})
#define FL(x,...) fill(ALL(__VA_ARGS__),x)
#define IOT(x,...) iota(ALL(__VA_ARGS__),x)
#define SIZ(G) sc(G.size())
#define SORA(G,x,y) sort(ALLA(G,x,y))
#define REVA(G,x,y) reverse(ALLA(G,x,y))
#define MINA(G,x,y) *min_element(ALLA(G,x,y))
#define MAXA(G,x,y) *max_element(ALLA(G,x,y))
#define SUMA(T,G,x,y) accumulate(ALLA(G,x,y),static_cast<T>(0))
#define LBA(G,x,y,v) lower_bound(ALLA(G,x,y),v)
#define UBA(G,x,y,v) upper_bound(ALLA(G,x,y),v)
#define LBGA(G,x,y,v) lower_bound(ALLA(G,x,y),v,greater{})
#define UBGA(G,x,y,v) upper_bound(ALLA(G,x,y),v,greater{})
#define FLA(G,x,y,v) fill(ALLA(G,x,y),x)
#define IOTA(G,x,y,v) iota(ALLA(G,x,y),x)
#define MEMS(G,v) memset(G,v,sizeof(G))
#define MEMSV(G,v,s) memset(G,v,s)
#define UNQ(G,x) \
sort(ALL(G,x)); \
G.erase(unique(ALL(G,x)),G.end());
#define UNQA(G,x,y) \
sort(ALLA(G,x,y)); \
register long long LEN=unique(ALLA(G,x,y))-G-1;
#define For1(a) for(register int i=1,i##_r=(a);i<=i##_r;++i)
#define For2(i,a) for(register int i=1,i##_r=(a);i<=i##_r;++i)
#define For3(i,a,b) for(register int i=(a),i##_r=(b);i<=i##_r;++i)
#define For4(i,a,b,c) for(register int i=(a),i##_r=(b);i<=i##_r;i+=(c))
#define For1R(a) for(register int i=(a);i>=1;--i)
#define For2R(i,a) for(register int i=(a);i>=1;--i)
#define For3R(i,a,b) for(register int i=(a),i##_r=(b);i>=i##_r;--i)
#define For4R(i,a,b,c) for(register int i=(a),i##_r=(b);i>=i##_r;i-=(c))
#define For01(a) for(register int i=0,i##_r=(a);i<i##_r;++i)
#define For02(i,a) for(register int i=0,i##_r=(a);i<i##_r;++i)
#define For03(i,a,b) for(register int i=(a),i##_r=(b);i<i##_r;++i)
#define For04(i,a,b,c) for(register int i=(a),i##_r=(b);i<i##_r;i+=(c))
#define For01R(a) for(register int i=(a)-1;i>=0;--i)
#define For02R(i,a) for(register int i=(a)-1;i>=0;--i)
#define For03R(i,a,b) for(register int i=(a)-1,i##_r=(b);i>=i##_r;--i)
#define For04R(i,a,b,c) for(register int i=(a)-1,i##_r=(b);i>=i##_r;i-=(c))
#define ForN1(a) for(register int i=1;i<=(a);++i)
#define ForN2(i,a) for(register int i=1;i<=(a);++i)
#define ForN3(i,a,b) for(register int i=(a);i<=(b);++i)
#define ForN4(i,a,b,c) for(register int i=(a);i<=(b);i+=(c))
#define ForN1R(a) for(register int i=(a);i>=1;--i)
#define ForN2R(i,a) for(register int i=(a);i>=1;--i)
#define ForN3R(i,a,b) for(register int i=(a);i>=(b);--i)
#define ForN4R(i,a,b,c) for(register int i=(a);i>=(b);i-=(c))
#define ForN01(a) for(register int i=0;i<(a);++i)
#define ForN02(i,a) for(register int i=0;i<(a);++i)
#define ForN03(i,a,b) for(register int i=(a);i<(b);++i)
#define ForN04(i,a,b,c) for(register int i=(a);i<(b);i+=(c))
#define ForN01R(a) for(register int i=(a)-1;i>=0;--i)
#define ForN02R(i,a) for(register int i=(a)-1;i>=0;--i)
#define ForN03R(i,a,b) for(register int i=(a)-1;i>=(b);--i)
#define ForN04R(i,a,b,c) for(register int i=(a)-1;i>=(b);i-=(c))
#define For1EG(u) for(register int i=head[u],to=edge[i].to;i;i=edge[i].nxt,to=edge[i].to)
#define For2EG(i,u) for(register int i=head[u],to=edge[i].to;i;i=edge[i].nxt,to=edge[i].to)
#define For3EG(i,u,w) for(register int i=head[u],to=edge[i].to,w=edge[i].w;i;i=edge[i].nxt,to=edge[i].to,w=edge[i].w)
#define For4EG(i,u,w,c) for(register int i=head[u],to=edge[i].to,w=edge[i].w,c=edge[i].c;i;i=edge[i].nxt,to=edge[i].to,w=edge[i].w,c=edge[i].w)
#define For1EGW(u) for(register int i=head[u],to=edge[i].to;i!=-1;i=edge[i].nxt,to=edge[i].to)
#define For2EGW(i,u) for(register int i=head[u],to=edge[i].to;i!=-1;i=edge[i].nxt,to=edge[i].to)
#define For3EGW(i,u,x) for(register int i=head[u],to=edge[i].to;i!=x;i=edge[i].nxt,to=edge[i].to)
#define For4EGW(i,u,w,x) for(register int i=head[u],to=edge[i].to,w=edge[i].w;i!=x;i=edge[i].nxt,to=edge[i].to,w=edge[i].w)
#define OverLoad(a,b,c,d,e,...) e
#define Overload(a,b,c,d,...) d
#define For(...) OverLoad(__VA_ARGS__,For4,For3,For2,For1)(__VA_ARGS__)
#define ForR(...) OverLoad(__VA_ARGS__,For4R,For3R,For2R,For1R)(__VA_ARGS__)
#define For0(...) OverLoad(__VA_ARGS__,For04,For03,For02,For01)(__VA_ARGS__)
#define For0R(...) OverLoad(__VA_ARGS__,For04R,For03R,For02R,For01R)(__VA_ARGS__)
#define ForN(...) OverLoad(__VA_ARGS__,ForN4,ForN3,ForN2,ForN1)(__VA_ARGS__)
#define ForNR(...) OverLoad(__VA_ARGS__,ForN4R,ForN3R,ForN2R,ForN1R)(__VA_ARGS__)
#define ForN0(...) OverLoad(__VA_ARGS__,ForN04,ForN03,ForN02,ForN01)(__VA_ARGS__)
#define ForN0R(...) OverLoad(__VA_ARGS__,ForN04R,ForN03R,ForN02R,ForN01R)(__VA_ARGS__)
#define ForEG(...) OverLoad(__VA_ARGS__,For4EG,For3EG,For2EG,For1EG)(__VA_ARGS__)
#define ForEGW(...) OverLoad(__VA_ARGS__,For4EGW,For3EGW,For2EGW,For1EGW)(__VA_ARGS__)
#define ALL(...) Overload(__VA_ARGS__,ALL3,ALL2,ALL1)(__VA_ARGS__)
#define RALL(...) Overload(__VA_ARGS__,RALL3,RALL2,RALL1)(__VA_ARGS__)
#define ForPR(...) for(bool flag=true;flag?exchange(flag,false):next_permutation(ALL(__VA_ARGS__));)
#define ForPRA(G,x,y) for(bool flag=true;flag?exchange(flag,false):next_permutation(G+x,G+y+1);)
#define ForSubset(msk,s) \
for(register int msk=(s);msk;msk&=msk-1)
#define Inline __inline__ __attribute__ ((always_inline))
#define Test() \
register int TestCount=MultiCase?read():1; \
for(register int TestCase=1;TestCase<=TestCount;++TestCase)
#define Tesf() for(register int TestCase=1;TestCase<=t;++TestCase)
#define RD(...) register long long __VA_ARGS__;io.read(__VA_ARGS__)
#define RS(...) string __VA_ARGS__;io.read(__VA_ARGS__)
#define RC(...) register char __VA_ARGS__;io.read(__VA_ARGS__)
#define RI(...) register int __VA_ARGS__;io.read(__VA_ARGS__)
#define RU32(...) register unsigned __VA_ARGS__;io.read(__VA_ARGS__)
#define RU64(...) register unsigned long long __VA_ARGS__;io.read(__VA_ARGS__)
#define RF32(...) register double __VA_ARGS__;io.read(__VA_ARGS__)
#define RF64(...) register long double __VA_ARGS__;io.read(__VA_ARGS__)
#define RSP(T,...) register T __VA_ARGS__;readsp(__VA_ARGS__)
#define RV(G,n) \
vector<long long>G(n+1); \
For(n){ \
G[i]=read(); \
}
#define RVV(G,n,m) \
vector<vector<long long>>G(n+1,vector<long long>(m+1)); \
For(n){ \
For(j,m){ \
G[i][j]=read(); \
} \
}
#ifdef ONLINE_JUDGE
//when on OJ,close the debug version
//hope code with no bugs.
//think twice,code once.
//timer won't print anything
//don't be TLE or MLE,only AC.
#undef Debug
#undef Setmemory
#define Debug(...) 42
#define Setmemory(tmp) 0
#if __cplusplus>201402L
#define register
#else
//becaus of using c++17 and higher version, register are not allowed to use.
#endif
#else
//open debug version.
//hope code with no bugs.
//because of using c++17, we need to undefine register.
//Debug will print out the things we need.
//Setmemory will set the end memory we need.
#define register
#define Debug(...) cerr << "Debug " << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define Setmemory(Tmp) (Timebot::timer.End=&Tmp,0)
template<typename A,typename B>string to_string(pair<A,B>p);
template<typename A,typename B,typename C>string to_string(tuple<A,B,C>p);
template<typename A,typename B,typename C,typename D>string to_string(tuple<A,B,C,D>p);
string to_string(const string&s){return'"'+s+'"';}
string to_string(const char*s){return to_string((string)s);}
string to_string(bool b){return(b?"true":"false");}
string to_string(vector<bool>v){bool first=true;string res="{";for(int i=0;i<static_cast<int>(v.size());i++){if(!first){res+=", ";}first=false;res+=to_string(v[i]);}res+="}";return res;}
template<size_t N>string to_string(bitset<N>v){string res="";for(size_t i=0;i<N;i++){res+=static_cast<char>('0'+v[i]);}return res;}
template<typename A>string to_string(A v){bool first=true;string res="{";for(const auto&x:v){if(!first){res+=", ";}first=false;res+=to_string(x);}res+="}";return res;}
template<typename A,typename B>string to_string(pair<A,B>p){return"("+to_string(p.first)+", "+to_string(p.second)+")";}
template<typename A,typename B,typename C>string to_string(tuple<A,B,C>p){return"("+to_string(get<0>(p))+", "+to_string(get<1>(p))+", "+to_string(get<2>(p))+")";}
template<typename A,typename B,typename C,typename D>string to_string(tuple<A,B,C,D>p){return"("+to_string(get<0>(p))+", "+to_string(get<1>(p))+", "+to_string(get<2>(p))+", "+to_string(get<3>(p))+")";}
inline void debug_out(){cerr<<endl;}
template<typename Head,typename...Tail>void debug_out(Head H,Tail...T){cerr<<" "<<to_string(H);debug_out(T...);}
namespace Timebot{
//timer will print the time and the memory of the code for you.
//don't be TLE or MLE,only AC.
struct Timer{
bool f,*Beg,*End;clock_t Begin;Timer():Begin(clock()),Beg(&f){}~Timer(){double t=(clock()-Begin)*1000./CLOCKS_PER_SEC;t>=60000?fprintf(stderr,"Time: %.2lf min\n",t/60000.):t>=1000?fprintf(stderr,"Time: %.2lf s\n",t/1000.):fprintf(stderr,"Time: %.0lf ms\n",t);fprintf(stderr,"Memory: %.3lf MB\n",(End-Beg)/1048576.0);}
}timer;
}
#endif
[[maybe_unused]]constexpr double pi=3.1415926535897932384626433832795,ei=2.7182818284590452353602874713527;
[[maybe_unused]]constexpr long long ZR=0,OE=1;//ignore error
[[maybe_unused]]constexpr long long NJ=10,NP3=14,NP2=20;//O(n!),O(3^n),O(2^n)
[[maybe_unused]]constexpr long long N31=110,N32=150,N33=210;//O(n^3)
[[maybe_unused]]constexpr long long N21=1010,N22=3030,N23=5050;//O(n^2)
[[maybe_unused]]constexpr long long N11=100100,N12=300300,N13=500500,N14=700700;//O(n)
[[maybe_unused]]constexpr long long NB1=1000100,NB2=3000300,NB3=5000500,NB4=7000700,NB5=10001000;//O(n)
[[maybe_unused]]constexpr long long USEMOD[]={0,20091119,11190119,121911211,998244353,19260817,1000000007,1145141};
[[maybe_unused]]constexpr __int128 PW10[]={1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000,10000000000,100000000000,1000000000000,10000000000000,100000000000000,1000000000000000,10000000000000000,100000000000000000,1000000000000000000,__int128(1000000000000000000)*10,__int128(1000000000000000000)*100,__int128(1000000000000000000)*1000,__int128(1000000000000000000)*10000,__int128(1000000000000000000)*100000,__int128(1000000000000000000)*1000000,__int128(1000000000000000000)*10000000,
__int128(1000000000000000000)*100000000,__int128(1000000000000000000)*1000000000,__int128(1000000000000000000)*10000000000,__int128(1000000000000000000)*100000000000,__int128(1000000000000000000)*1000000000000,__int128(1000000000000000000)*1000000000000,__int128(1000000000000000000)*100000000000000,__int128(1000000000000000000)*1000000000000000,__int128(1000000000000000000)*10000000000000000,__int128(1000000000000000000)*100000000000000000,__int128(1000000000000000000)*1000000000000000000};
template<class T>constexpr T Infty=0;
template<>constexpr int Infty<int> =1000000000;
template<>constexpr long long Infty<long long> =2000000000000000000;
template<>constexpr unsigned Infty<unsigned> =1000000000;
template<>constexpr unsigned long long Infty<unsigned long long> =2000000000000000000;
template<>constexpr __int128 Infty<__int128> =__int128(Infty<long long>)*Infty<long long>;
template<>constexpr long double Infty<long double> =2e18;
template<>constexpr __float128 Infty<__float128> =2e18;
template<>constexpr double Infty<double> =2e18;
template<class T>Inline T Min(register T a,register T b){return a<b?a:b;}
template<class T>Inline T Max(register T a,register T b){return a>b?a:b;}
template<class T>inline T Min(initializer_list<T>a){register T x=numeric_limits<T>::max();for(auto &&it:a){x=Min(x,it);}return x;}
template<class T>inline T Max(initializer_list<T>a){register T x=numeric_limits<T>::min();for(auto &&it:a){x=Max(x,it);}return x;}
template<class T,class Q>Inline bool Cmin(register T&a,register Q b){return a>b?(a=b,true):false;}
template<class T,class Q>Inline bool Cmax(register T&a,register Q b){return a<b?(a=b,true):false;}
template<class T,class Q>inline bool Cmin(register T&a,initializer_list<Q>b){register T x=a;for(auto &&it:b){Cmin(a,it);}return x==a?false:true;}
template<class T,class Q>inline bool Cmax(register T&a,initializer_list<Q>b){register T x=a;for(auto &&it:b){Cmax(a,it);}return x==a?false:true;}
template<class T>Inline T Abs(register T a){return a>0?a:-a;}
template<class T>inline T Floor(register T a,register T b){return a/b-(a%b&&(a^b)<0);}
template<class T>inline T Ceil(register T a,register T b){return Floor(a+b-1,b);}
template<class T>inline T Bmod(register T a,register T b){return a-b*Floor(a,b);}
template<class T>inline pair<T,T>Divmod(register T a,register T b){register T q=Floor(a,b);return gp(q,a-q*b);}
template<class T>Inline T Lowbit(register T x){return (x&-x);}
template<class T>Inline T Topbit(register T x){return 63-__builtin_clzll(x);}
template<class T>Inline void Swap(register T&a,register T&b){return a!=b?b^=a^=b^=a,void():void();}
template<class T>inline T Gcd(T a,T b){return b?Gcd(b,a%b):a;}
template<class T>inline T Lcm(T a,T b){return a*b/Gcd(a,b);}
template<class T>inline T Exgcd(T a,T b,T&x,T&y){if(b==0){x=1;y=0;return a;}T d=Exgcd(b,a%b,x,y);T t=x;x=y;y=t-a/b*y;return d;}
template<class T>inline T ExExgcd(T a,T b,T&x,T&y,T c){if(b==0){x=c;y=0;return a;}T d=ExExgcd(b,a%b,x,y,c);T t=x;x=y;y=t-a/b*y;return d;}
template<class T>inline T Ksc(T a,T b){if(a==0||b==0){return 0;}T ans=0;while(b){if(b&1){ans=a+ans;}a=a+a;b>>=1;}return ans;}
template<class T>inline T Ksc(T a,T b,T p){if(a==0||b==0){return 0;}T ans=0;while(b){if(b&1){ans=(a+ans)%p;}a=(a+a)%p;b>>=1;}return ans;}
template<class T>inline T Ksm(T a,T b,bool f=false){if(a==0&&b==0)return 1;if(a==0){return 0;}if(b==0){return 1;}T ans=1;while(b){if(b&1){ans=!f?a*ans:Ksc(a,ans);}a=!f?a*a:Ksc(a,a);b>>=1;}return ans;}
template<class T>inline T Ksm(T a,T b,T p,bool f=false){if(a==0&&b==0)return 1;if(a==0){return 0;}if(b==0){return 1%p;}T ans=1;while(b){if(b&1){ans=!f?a*ans%p:Ksc(a,ans,p);}a=!f?a*a%p:Ksc(a,a,p);b>>=1;}return ans;}
template<class T>inline T Inv(T x,T p){return Ksm(x,p-2,p);}
template<class T>inline T Fac(T n){if(n==0){return 1;}int ans=1;for(register int i=1;i<=n;++i){ans*=i;}return ans;}
template<class T>inline T Fac(T n,T p){if(n==0){return 1;}register long long ans=1;for(register int i=1;i<=n;++i){ans=ans*i%p;}return ans;}
template<class T>inline vector<pair<T,T>>Factor(T x){vector<pair<T,T>>ans;for(register T i=2;i*i<=x;++i)if(x%i==0){ans.emplace_back(i,1);while((x/=i)%i==0)++ans.back().second;}x!=1?ans.emplace_back(x,1),0:0;return ans;}
template<class T>vector<T>Divisor(T x){vector<T>ans;for(register T i=1;i*i<=x;++i)if(x%i==0)ans.emplace_back(i),i*i!=x?ans.emplace_back(x/i),0:0;return ans;}
template<class T>Inline int Popcount(T x,bool f=true){return f?__builtin_popcountll(x):__builtin_popcount(x);}
template<class T>Inline int Prebit(T x,bool f=true){return f?__builtin_clzll(x):__builtin_clz(x);}
template<class T>Inline int Sufbit(T x,bool f=true){return f?__builtin_ctzll(x):__builtin_ctz(x);}
template<class T>Inline int Lowone(T x,bool f=true){return f?__builtin_ffsll(x):__builtin_ffs(x);}
template<class T>Inline int Parity(T x,bool f=true){return f?__builtin_parityll(x):__builtin_parity(x);}
template<class T>Inline bool Isdigit(T ch){return ch>='0'&&ch<='9';}
template<class T>Inline bool Isletter(T ch){return ch>='A'&&ch<='Z'||ch>='a'&&ch<='z';}
template<class T>Inline bool Isupper(T ch){return ch>='A'&&ch<='Z';}
template<class T>Inline bool Islower(T ch){return ch>='a'&&ch<='z';}
template<class T>Inline char Tolower(T ch){return ch-'A'+'a';}
template<class T>Inline char Toupper(T ch){return ch-'a'+'A';}
template<class T>inline void Memset(T*d,long long n,long long s){for(register int i=0;i<=s-1;++i){d[i]=n;}}
template<class T>inline void Bug(T x,string name){cerr<<name<<": "<<x<<endl;}
template<class T>inline void Bug(T x){cerr<<x<<endl;}
template<class T>inline T Sin(register T degree){return sinl(degree*(pi/180));}
template<class T>inline T Cos(register T degree){return cosl(degree*(pi/180));}
template<class T>inline T Tan(register T degree){return tanl(degree*(pi/180));}
template<class T>inline T Asin(register T degree){return asinl(degree)*180.0/pi;}
template<class T>inline T Acos(register T degree){return acosl(degree)*180.0/pi;}
template<class T>inline T Atan(register T degree){return atanl(degree)*180.0/pi;}
template<class T>inline T Gpop(stack<T>&q){register T u=q.top();q.pop();return u;}
template<class T>inline T Gpop(queue<T>&q){register T u=q.front();q.pop();return u;}
template<class T>inline T Gpop(deque<T>&q){register T u=q.front();q.pop_front();return u;}
template<class T>inline T Gpop(priority_queue<T>&q){register T u=q.top();q.pop();return u;}
template<class T>inline T Gpop(priority_queue<T,vector<T>,greater<T>>&q){register T u=q.top();q.pop();return u;}
template<class T>inline T Gpop(vector<T>&G){register T u=G.back();G.pop_back();return u;}
template<class T>inline vector<T>Presum(vector<T>&a,int ind=1){vector<T>sum(SIZ(a)+0);For (i,ind,SIZ(a)-1){sum[i]=sum[i-1]+a[i];}return sum;}
template<class T>inline vector<T>Sufsum(vector<T>&a,int ind=1){vector<T>sum(SIZ(a)+1);ForR(i,SIZ(a)-1,ind){sum[i]=sum[i+1]+a[i];}return sum;}
template<class T>inline vector<T>Rearrange(vector<T>&a,vector<T>&ind,int id=1){vector<T>p(SIZ(ind)+id);For(i,ind,SIZ(ind)-(id^1)){p[i]=a[ind[i]];}return p;}
template<class T>inline vector<long long>Argsort(vector<T>&a,int id=1){vector<long long>ind(SIZ(a));iota(ALL(ind,id),0);sort(ALL(ind,id),[&](int i,int j){return a[i]==a[j]?i<j:a[i]<a[j];});return ind;}
template<class T>inline vector<long long>TransSV(T &s,char ch,char sp='?',int ind=1){vector<long long>G(SIZ(s)+ind);For(i,ind,SIZ(s)-1){G[i]=s[i]==sp?-1:s[i]-ch;}return G;}
template<class T>inline long long Rand(T l,T r){static mt19937_64 Rd(chrono::steady_clock::now().time_since_epoch().count());return uniform_int_distribution<long long>(l,r)(Rd);}
template<class T,class F>inline T Binarysearch(T l,T r,T f,const F &check,bool D=true){T mid,ans;for(mid=(l+r)>>1,ans=f;l<=r;mid=(l+r)>>1){check(mid)?ans=mid,(D?r=mid-1:l=mid+1):(D?l=mid+1:r=mid-1);}return ans;}
template<class T,class F>inline T Binarysearch(T l,T r,T f,double eps,const F &check,bool D=true){T mid,ans;for(mid=(l+r)/2;r-l>eps;mid=(l+r)/2){check(mid)?ans=mid,(D?l=mid:r=mid):(D?r=mid:l=mid);}return ans;}
template<class T>inline void Radixsort(register const int n,T*a,T*b){int r1[0x100],r2[0x100],r3[0x100],r4[0x100];memset(r1,0,sizeof(r1));memset(r2,0,sizeof(r2));memset(r3,0,sizeof(r3));memset(r4,0,sizeof(r4));register int i,tmp_int;register T*j,*tar;for(j=a+1,tar=a+n+1;j!=tar;++j){tmp_int=*(int*)j;++r1[tmp_int&0xff];++r2[(tmp_int>>8)&0xff];++r3[(tmp_int>>16)&0xff];++r4[tmp_int>>24];}for(i=1;i<=0xff;++i){r1[i]+=r1[i-1];r2[i]+=r2[i-1];r3[i]+=r3[i-1];r4[i]+=r4[i-1];}for(j=a+n;j!=a;--j){tmp_int=*(int*)j;b[r1[tmp_int&0xff]--]=*j;}for(j=b+n;j!=b;--j){tmp_int=*(int*)j;a[r2[(tmp_int>>8)&0xff]--]=*j;}for(j=a+n;j!=a;--j){tmp_int=*(int*)j;b[r3[(tmp_int>>16)&0xff]--]=*j;}for(j=b+n;j!=b;--j){tmp_int=*(int*)j;a[r4[tmp_int>>24]--]=*j;}}
template<class T>inline void Radixsort(register const int n,T*a,T*b,bool op){size_t size_of_type=sizeof(T);size_t num_of_buc=size_of_type>>1;unsigned**r=new unsigned*[num_of_buc];register int i,k;for(i=0;i<num_of_buc;++i){r[i]=new unsigned[0x10000];memset(r[i],0,0x10000*sizeof(unsigned));}register unsigned short tmp_us;register T*j,*tar;for(k=0;k<num_of_buc;++k){for(j=a+1,tar=a+n+1;j!=tar;++j){tmp_us=*(((unsigned short*)j)+k);++r[k][tmp_us];}}for(k=0;k<num_of_buc;++k){for(i=1;i<=0xffff;++i){r[k][i]+=r[k][i-1];}}for(k=0;k<num_of_buc;k+=0x2){i=k;for(j=a+n;j!=a;--j){tmp_us=*(((unsigned short*)j)+i);b[r[i][tmp_us]--]=*j;}i|=1;if(i==num_of_buc){break;}for(j=b+n;j!=b;--j){tmp_us=*(((unsigned short*)j)+i);a[r[i][tmp_us]--]=*j;}}for(int i=0;i<num_of_buc;i++){delete[]r[i];}delete[]r;}
template<class T>inline void Radixsort(register const int n,T*a,T*b,bool op1,bool op2){Radixsort(n,a,b,true);reverse(a+1,a+n+1);reverse(upper_bound(a+1,a+n+1,(T)(-0.0)),a+n+1);}
template<int R,int L=0,int M=(L+R>>1),class T>Inline void Unroll(int i,T f){R-L==1?f(L+i):(Unroll<M,L>(i,f),Unroll<R,M>(i,f));}
inline void OF(string s){string IN=s+".in";string OUT=s+".out";freopen(IN.c_str(),"r",stdin);freopen(OUT.c_str(),"w",stdout);}
inline void CF(string s){fclose(stdin);fclose(stdout);}
struct Safe_Hash{
static unsigned long long splitmix64(unsigned long long x){x+=0x9e3779b97f4a7c15;x=(x^(x>>30))*0xbf58476d1ce4e5b9;x=(x^(x>>27))*0x94d049bb133111eb;return x^(x>>31);}
size_t operator()(unsigned long long x)const{static const unsigned long long FIXED_RANDOM=chrono::steady_clock::now().time_since_epoch().count();return splitmix64(x+FIXED_RANDOM);}
};
#define UseBuffer
struct IO{
#ifdef UseBuffer
//unlockeds somtimes are a little faster than normals
//#define fread fread_unlocked
//#define fwrite fwrite_unlocked
const static int BUFSIZE=1<<20;
char buf[BUFSIZE],obuf[BUFSIZE],*p1,*p2,*pp;
inline char getchar(){return(p1==p2&&(p2=(p1=buf)+fread(buf,1,BUFSIZE,stdin),p1==p2)?EOF:*p1++);}
inline void putchar(char x){((pp-obuf==BUFSIZE&&(fwrite(obuf,1,BUFSIZE,stdout),pp=obuf)),*pp=x,pp++);}
inline IO&flush(){fwrite(obuf,1,pp-obuf,stdout);fflush(stdout);return*this;}
IO(){p1=buf,p2=buf,pp=obuf;}
~IO(){flush();}
#else
//remember to flush in interactive problems
//int(*getchar)()=&::getchar_unlocked;
//int(*putchar)(int)=&::putchar_unlocked;
int(*getchar)()=&::getchar;
int(*putchar)(int)=&::putchar;
inline IO&flush(){fflush(stdout);return*this;};
#endif
int k=2;
string sep=" ";
template<typename Tp,typename enable_if<is_integral<Tp>::value||is_same<Tp,__int128_t>::value>::type* =nullptr>inline int read(Tp&s){int f=1;char ch=getchar();s=0;while(!isdigit(ch)&&ch!=EOF)f=(ch=='-'?-1:1),ch=getchar();while(isdigit(ch))s=s*10+(ch^48),ch=getchar();s*=f;return ch!=EOF;}
template<typename Tp,typename enable_if<is_floating_point<Tp>::value>::type* =nullptr>inline int read(Tp&s){int f=1;char ch=getchar();s=0;while(!isdigit(ch)&&ch!=EOF&&ch!='.')f=(ch=='-'?-1:1),ch=getchar();while(isdigit(ch))s=s*10+(ch^48),ch=getchar();if(ch==EOF)return false;if(ch=='.'){Tp eps=0.1;ch=getchar();while(isdigit(ch))s=s+(ch^48)*eps,ch=getchar(),eps/=10;}s*=f;return ch!=EOF;}
inline int read(char&c){char ch=getchar();c=EOF;while(isspace(ch)&&ch!=EOF)ch=getchar();if(ch!=EOF)c=ch;return c!=EOF;}
inline int read(char*c){char ch=getchar(),*s=c;while(isspace(ch)&&ch!=EOF)ch=getchar();while(!isspace(ch)&&ch!=EOF)*(c++)=ch,ch=getchar();*c='\0';return s!=c;}
inline int read(string&s){s.clear();char ch=getchar();while(isspace(ch)&&ch!=EOF)ch=getchar();while(!isspace(ch)&&ch!=EOF)s+=ch,ch=getchar();return s.size()>0;}
inline int getline(char*c,const char&ed='\n'){char ch=getchar(),*s=c;while(ch!=ed&&ch!=EOF)*(c++)=ch,ch=getchar();*c='\0';return s!=c;}
inline int getline(string&s,const char&ed='\n'){s.clear();char ch=getchar();while(ch!=ed&&ch!=EOF)s+=ch,ch=getchar();return s.size()>0;}
template<typename Tp=int>inline Tp read(){Tp x;read(x);return x;}
template<typename Tp,typename...Ts>int read(Tp&x,Ts&...val){return read(x)&&read(val...);}
template<typename Tp,typename enable_if<is_integral<Tp>::value>::type* =nullptr>IO&write(Tp x){if(x<0)putchar('-'),x=-x;static char sta[114];int top=0;do sta[top++]=x%10+'0',x/=10;while(x);while(top)putchar(sta[--top]);return*this;}
inline IO&write(const string&str){for(char ch:str)putchar(ch);return*this;}
inline IO&write(const char*str){while(*str!='\0')putchar(*(str++));return*this;}
inline IO&write(char*str){return write((const char*)str);}
inline IO&write(const char&ch){return putchar(ch),*this;}
template<typename Tp,typename enable_if<is_floating_point<Tp>::value>::type* =nullptr>inline IO&write(Tp x){if(x>1e18||x<-1e18){write("[Floating point overflow]");throw;}if(x<0)putchar('-'),x=-x;const static long long pow10[]={1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000,10000000000,100000000000,1000000000000,10000000000000,100000000000000,1000000000000000,10000000000000000,100000000000000000,100000000000000000,100000000000000000};const auto&n=pow10[k];long long whole=(int)x;double tmp=(x-whole)*n;long long frac=tmp;double diff=tmp-frac;if(diff>0.5){++frac;if(frac>=n)frac=0,++whole;}else if(diff==0.5&&((frac==0U)||(frac&1U)))++frac;write(whole);if(k==0U){diff=x-(double)whole;if((!(diff<0.5)||(diff>0.5))&&(whole&1))++whole;}else{putchar('.');static char sta[20];int count=k,top=0;while(frac){sta[top++]=frac%10+'0';frac/=10,count--;}while(count--)putchar('0');while(top)putchar(sta[--top]);}return*this;}
template<typename Tp,typename...Ts>inline IO&write(Tp x,Ts...val){write(x);write(sep);write(val...);return*this;}
template<typename...Ts>inline IO&writeln(Ts...val){write(val...);putchar('\n');return*this;}
inline IO&writeln(void){putchar('\n');return*this;}
template<typename Tp>inline IO&writeWith(Tp x,const string&s=" "){write(x),write(s);return*this;}
inline IO&setsep(const string&s){return sep=s,*this;}
inline IO&setprec(const int&K){return k=K,*this;}
}io;
inline int rd(){return io.read<int>();}
inline long long read(){return io.read<long long>();}
inline unsigned long long Read(){return io.read<unsigned long long>();}
template<class T,size_t x>inline void readsp(array<T,x>&G){For0(x)io.read(G[i]);return void();}
template<class T,class Q>inline void readsp(pair<T,Q>&x){io.read(x.first,x.second);return void();}
template<class T,class...Args>inline void readsp(T&x,Args&...args){readsp(x);readsp(args...);return void();}
template<class T>inline bool wrt(T x){return io.write(x),true;}
template<class T>inline bool Write(T x,string ch="\n"){return io.writeWith(x,ch),true;}
template<class...T>inline bool write(T...x){io.write(x...);io.putchar('\n');return true;}
template<class T,size_t x>inline bool writesp(const array<T,x>&G){For0(x)Write(G[i],i==x-1?"\n":" ");return true;}
template<class T,class Q>inline bool writesp(const pair<T,Q>&x){Write(x.first," ");write(x.second);return true;}
template<class T>inline bool writesp(vector<T>&G){if(G.empty())return false;register int sz=SIZ(G)-1;For(sz){Write(G[i],i==sz?"\n":" ");}return true;}
template<class T,class...Args>inline bool writesp(T x,Args&...args){writesp(x);writesp(args...);return true;}
inline bool WRITE(__int128 x,char ch='\n'){if(x<0)io.putchar('-'),x=-x;static char sta[114];int top=0;do sta[top++]=x%10+'0',x/=10;while(x);while(top)io.putchar(sta[--top]);io.putchar(ch);return true;}
//#endif
/*
Good Luck!
Have Fun!
CSPS RP++
NOIP RP++
OI RP++
NOI RP++
CTT RP++
CTS RP++
IOI RP++
ZKA RP++
GKA RP++
KAY RP++
KAB RP++
WHK RP++
Goal:
CF GM
AT 2DAN
LG Lv9
To be continued...
*/
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.......RRRRRRRRRRRRRRRRRRRR...................PPPPPPPPPPPPPPPPPPPP...............................................
//.......RRRRRRRRRRRRRRRRRRRRRR.................PPPPPPPPPPPPPPPPPPPPPP.............................................
//.......RRRRRRRRRRRRRRRRRRRRRRR................PPPPPPPPPPPPPPPPPPPPPPPP...........................................
//.......RRRR.................RRRRR.............PPPP...............PPPPP...........................................
//.......RRRR.................RRRRR.............PPPP................PPPPP..........................................
//.......RRRR.................RRRRR.............PPPP................PPPPP..........................................
//.......RRRR...............RRRRR...............PPPP...............PPPPP...........................................
//.......RRRR............RRRRRR.................PPPP.............PPPPPP............................................
//.......RRRR............RRRRRR.................PPPP............PPPPPP.............................................
//.......RRRR........RRRRRR.....................PPPP........PPPPPPP................................................
//.......RRRRRRRRRRRRRRRRRR.....................PPPPPPPPPPPPPPPPPP.................................................
//.......RRRRRRRRRRRRRRRRRR.....................PPPPPPPPPPPPPPPP...................................................
//.......RRRR..........RRRR.....................PPPPP.................................+++................+++.......
//.......RRRR...........RRRR....................PPPPP.................................+++................+++.......
//.......RRRR.............RRRR..................PPPPP.................................+++................+++.......
//.......RRRR..............RRRR.................PPPPP...........................+++++++++++++++....+++++++++++++++.
//.......RRRR...............RRRR................PPPPP...........................+++++++++++++++....+++++++++++++++.
//.......RRRR................RRRR...............PPPPP.................................+++................+++.......
//.......RRRR.................RRRR..............PPPPP.................................+++................+++.......
//.......RRRR...................RRRR............PPPPP.................................+++................+++.......
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.......RRRRRRRRRRRRRRRRRRRR...................PPPPPPPPPPPPPPPPPPPP...............................................
//.......RRRRRRRRRRRRRRRRRRRRRR.................PPPPPPPPPPPPPPPPPPPPPP.............................................
//.......RRRRRRRRRRRRRRRRRRRRRRR................PPPPPPPPPPPPPPPPPPPPPPPP...........................................
//.......RRRR.................RRRRR.............PPPP...............PPPPP...........................................
//.......RRRR.................RRRRR.............PPPP................PPPPP..........................................
//.......RRRR.................RRRRR.............PPPP................PPPPP..........................................
//.......RRRR...............RRRRR...............PPPP...............PPPPP...........................................
//.......RRRR............RRRRRR.................PPPP.............PPPPPP............................................
//.......RRRR............RRRRRR.................PPPP............PPPPPP.............................................
//.......RRRR........RRRRRR.....................PPPP........PPPPPPP................................................
//.......RRRRRRRRRRRRRRRRRR.....................PPPPPPPPPPPPPPPPPP.................................................
//.......RRRRRRRRRRRRRRRRRR.....................PPPPPPPPPPPPPPPP...................................................
//.......RRRR..........RRRR.....................PPPPP.................................+++................+++.......
//.......RRRR...........RRRR....................PPPPP.................................+++................+++.......
//.......RRRR.............RRRR..................PPPPP.................................+++................+++.......
//.......RRRR..............RRRR.................PPPPP...........................+++++++++++++++....+++++++++++++++.
//.......RRRR...............RRRR................PPPPP...........................+++++++++++++++....+++++++++++++++.
//.......RRRR................RRRR...............PPPPP.................................+++................+++.......
//.......RRRR.................RRRR..............PPPPP.................................+++................+++.......
//.......RRRR...................RRRR............PPPPP.................................+++................+++.......
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
//.................................................................................................................
using tp=long long;
using i16=short;
using i64=long long;
using i128=__int128;
using u16=unsigned short;
using u32=unsigned;
using u64=unsigned long long;
using u128=unsigned __int128;
using d32=double;
using d64=long double;
using d128=__float128;
template<class T,class Q>using pr=pair<T,Q>;
template<class T=tp,size_t x=3>using ar=array<T,x>;
template<class T=tp>using vc=vector<T>;
template<class T=tp>using vvc=vector<vc<T>>;
template<class T=tp>using vvvc=vector<vvc<T>>;
template<class T=tp>using vvvvc=vector<vvvc<T>>;
template<class T=tp>using vvvvvc=vector<vvvvc<T>>;
template<class T=tp>using pqueue=priority_queue<T>;
template<class T=tp>using bqueue=priority_queue<T,vector<T>,greater<T>>;
template<class T=tp,class Q=tp,class R=tp>using tup=tuple<T,Q,R>;
template<class T=tp,class Q=tp,class R=tp,class S=tp>using ttup=tuple<T,Q,R,S>;
template<class T=tp,class Q=tp,class R=tp,class S=tp,class U=tp>using tttup=tuple<T,Q,R,S,U>;
#define CurClock(T) static_cast<T>(chrono::steady_clock::now().time_since_epoch().count())
#define mtset(T) multiset<T>
#define mtmap(T) multimap<T>
#define umap(T) unordered_map<T>
#define uset(T) unordered_set<T>
#define umset(T) unordered_multiset<T>
#define Treap(T) __gnu_pbds::tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>
#define HashTable(T,Func) __gnu_pbds::gp_hash_table<T,T,Func>
#define FibHeap(T,Cmp) __gnu_pbds::priority_queue<T,Cmp,thin_heap_tag>
#define PairHeap(T,Cmp) __gnu_pbds::priority_queue<T,Cmp,pairing_heap_tag>
#define vv(T,G,a,...) vvc<T>G(a,vc<T>(__VA_ARGS__))
#define vvv(T,G,a,b,...) vvvc<T>G(a,vvc<T>(b,vc<T>(__VA_ARGS__)))
#define vvvv(T,G,a,b,c,...) vvvvc<T>G(a,vvvc<T>(b,vvc<T>(c,vc<T>(__VA_ARGS__))))
#define vvvvv(T,G,a,b,c,d,...) vvvvvc<T>G(a,vvvvc<T>(b,vvvc<T>(c,vvc<T>(d,vc<T>(__VA_ARGS__)))))
using pt=pr<tp,tp>;
using ar3=ar<tp,3>;
using ar4=ar<tp,4>;
[[maybe_unused]]constexpr long long N=1000100;bool MultiCase;
inline int SolveMain([[maybe_unused]]long long TC);
inline void InitMain();
#if 1
int main(){
// OF("test");
InitMain();
Test()SolveMain(TestCase);
return 0;
}
#endif
inline void InitMain(){
MultiCase=false;
return void();
}
#if 0
1. close Buffer when meeting interactive problems, flush when output.
2. check files when meeting file IO problems.
3. check the size of vectors, and the memory.
4. long long is slower than int, do not use it when the coef is big.
5. delete Debug code or use "//" or "/**/" or "#if 0".
6. initialize, especially "tp a[...]={}", it can cause weird errors.
7. think twice, code once, especially ad-hoc, maths, dp, constructive problems.
8. think of "[l,r]" of Binarysearch, and the "ans's" special value.
9. make special datas and the limit data when "Duipai", try to make the strongest data you can think.
10. notice int overflow(use long long), long long overflow(use __int128)/MLE(use int or bitfield).
To be continued...
To be continued...
To be continued...
To be continued...
To be continued...
To be continued...
To be continued...
To be continued...
To be continued...
To be continued...
To be continued...
To be continued...
CSPJRP++
CSPSRP++
NOIPRP++
FJOIRP++
NOIRP++
CTTRP++
CTSRP++
IOIRP++
THUSC/THUWCRP++
PKUSC/PKUWCRP++
ZHOKAORP++
GAOKAORP++
#endif
struct Frac{
tp a,b;
Frac(tp x=0,tp y=1){
a=x;b=y;
}
inline void write(){
register tp g=Gcd(a,b);
a/=g;b/=g;b<0?a=-a,b=-b:0;Write(a,"/");::write(b);
}
friend bool operator > (Frac a,Frac b){
return a.a*b.b-b.a*a.b>0;
}
friend bool operator < (Frac a,Frac b){
return a.a*b.b-b.a*a.b<0;
}
friend bool operator == (Frac a,Frac b){
return a.a==b.a&&a.b==b.b;
}
friend bool operator != (Frac a,Frac b){
return a.a!=b.a||a.b!=b.b;
}
#define stO(op) friend bool operator op (Frac a,tp b){return a op Frac(b);}
stO(>)
stO(<)
stO(==)
stO(!=)
#undef stO
}st[20][N],coef[N][20];
inline int SolveMain([[maybe_unused]]long long TC){
RD(n,k,q,op);--k;
RV(a,n);RV(b,n);void();Frac ans(0,0);
For(n){
Frac sum(0,0),mx(0,1);
For0(j,i,i+k)sum.a+=a[0+j+0],sum.b+=b[0+j+0];
For0(j, k+1)sum.a+=a[i+j+k],sum.b+=b[i+j+k],coef[i][j]=Max(mx,sum),Cmax(mx,sum);
}
auto Build=[&](){
For(n)st[0][i]=coef[i][k];
For(19)For(j,n-(1<<i)+1)st[i][j]=Max(st[i-1][j],st[i-1][j+(1<<i-1)]);return void();
};
auto Query=[&](tp l,tp r){
register tp k=__lg(r-l+1);
return Max(st[k][l],st[k][r-(1<<k)+1]);
};
Build();
For($,q){
RD(l,r);
l=(l^ans.a*op)%n+1;
r=(r^ans.a*op)%n+1;
l>r?Swap(l,r):void();Debug(l,r);
l<=r-k-k?ans=Query(l,r-k-k),l=r-k-k+1:ans=Frac(0,1);
For(i,l,r-k)Cmax(ans,coef[i][r-k-i]);ans.write();void();void();
}
return 0;
}剪贴板
剪贴板 gfp769id
剪贴板信息
剪贴板信息
- 收录
- 更新