#include #include #include #include #include #include #include int main(){ int n; int a; int b; int q; scanf("%d %d %d %d",&n,&a,&b,&q); int *c = malloc(sizeof(int) * n); for(int c_i = 0; c_i < n; c_i++){ scanf("%d",&c[c_i]); } for(int a0 = 0; a0 < q; a0++){ int q; int f; int s; scanf("%d %d %d",&q,&f,&s); if(q==1) c[f] = s; else { if(b==0) { if(c[f]!=0) printf("No\n"); else printf("Yes\n"); } else if(b!=0){ long long int k = -(b/a),k1=0,sum=0; for(int i=f;i<=s;i++) { long long k2 = pow(k,k1); //printf("%lld ",k2); sum+=c[i]*k2; k1++; } if(sum==0) printf("Yes\n"); else printf("No\n");} } // your code goes here } return 0; }