#include using namespace std; #define pb push_back #define mp make_pair #define ft first #define sd second #define mem(a, v) memset(a, v, sizeof(a)) typedef long long ll; typedef pair PII; typedef vector VI; typedef vector matrix; const ll MOD = 1000000007LL; int c[100100]; int main() { int n, a, b, q; cin>>n>>a>>b>>q; int g = __gcd(a, b); a /= g; b /= g; for(int i=1; i<=n; i++) { cin>>c[i]; } while(q--) { int x, l, r; cin>>x>>l>>r; if(x == 1) c[l+1] = r; else { l++, r++; int pre = 0, flag = 0; for(int i=r; i>l; i--) { int cur = abs(c[i] - pre * b); // cout<<"cur : "<