#include #include #include #include #include #include #include #include #include #include #include #include #include #include //setbase - cout << setbase (16); cout << 100 << endl; Prlls 64 //setfill - cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77 //setprecision - cout << setprecision (4) << f << endl; Prints x.xxxx using namespace std; #define f(i,a,b) for(i=a;i=b;i--) #define pb push_back #define mp make_pair #define vi vector< int > #define vl vector< ll > #define ss second #define ff first #define ll long long #define pii pair< int,int > #define pll pair< ll,ll > #define sz(a) a.size() #define inf (1000*1000*1000+5) #define all(a) a.begin(),a.end() #define tri pair #define vii vector #define vll vector #define viii vector #define mod (1000*1000*1000+7) #define pqueue priority_queue< int > #define pdqueue priority_queue< int,vi ,greater< int > > //std::ios::sync_with_stdio(false); ll gcd(ll a,ll b){ while(b!=0){ a=a%b; swap(a,b); } return a; } ll extend_gcd(ll a,ll b,ll &x,ll &y){ if(b==0){ x=1; y=0; return a; } ll x1,y1; ll ans =extend_gcd(b,a%b,x1,y1); x=y1; y=x1-(a/b)*y1; return ans; } ll segtree[123456*4]; ll mainq[123456],poly[123456]; ll construct(ll node,ll s,ll e){ if(s==e){ segtree[node]=mainq[s]; return 0; } ll mid=(s+e)/2; construct(2*node,s,mid); construct(2*node+1,mid+1,e); segtree[node]=(segtree[2*node]+segtree[2*node+1])%mod; return 0; } ll query(ll node,ll s,ll e,ll l,ll r){ if(e>n>>a>>b>>q; extend_gcd(mod,a,x,y); y=y%mod; y+=mod; y%=mod; b=y*b; b%=mod; b*=-1; b%=mod; b+=mod; b%=mod; powb[0]=1; ll i; //cout<>poly[i]; mainq[i]=poly[i]*powb[i]; mainq[i]%=mod; } construct(1,0,n-1); while(q--){ ll ty; cin>>ty; if(ty==1){ ll x1; ll x2; cin>>x1>>x2; x2*=powb[x1]; x2%=mod; update(1,0,n-1,x1,x2); } else{ ll x1,x2; cin>>x1>>x2; if(query(1,0,n-1,x1,x2)==0) cout<<"Yes"<