#include using namespace std; using Int=long long; using Real=long double; templateinline bool chmin(T&A,S B){return(A>B?A=B,1:0);} templateinline bool chmax(T&A,S B){return(A>D; REP(i,D+1)cin>>A[i]; for(;D>2;--D)A[D-2]+=A[D]; int d=A[2]?2:A[1]?1:0; cout<>T; while(T--)sol(); }