#include using namespace std; typedef long long ll; #define pb push_back #define fi first #define se second typedef pair P; #define Mod 1000000007 using VP = vector

; using VVP = vector; using VI = vector; using VVI = vector; using VVVI = vector; #define INF 1ll<<59 ll n,k; vector c(15010,0); int main(){ ll i,j; cin>>n>>k; ll a[n]; for(i=0;i>a[i]; } c[0]=1; for(i=0;i=0;j--){ if(j>=a[i]) c[j]+=c[j-a[i]]; } } ll q; cin>>q; for(i=0;i>x>>v; x--; ll u=a[x]; if(u!=0){ for(j=0;j<=15000;j++){ if(j>=u) c[j]=c[j]-c[j-u]; } } else{ for(j=0;j<=15000;j++){ c[j]=c[j]/2; } } if(v!=0){ for(j=15000;j>=0;j--){ if(j>=v) c[j]+=c[j-v]; } } else { for(j=15000;j>=0;j--){ c[j]=2*c[j]; } } if(c[k]>0) cout<<1<0) cout<