#include using namespace std; int n; int pref[100005]; int a[100005]; void update(int l,int r,int x){ pref[l]+=x; pref[r+1]-=x; } void printArray(){ for(int i=1;i>n; for(int i=0;i>a[i]; } while(1){ int choice; cout<<"Enter choice= \n"; cin>>choice; if(choice==1){ int l,r,x; cin>>l>>r>>x; update(l,r,x); } else{ printArray(); memset(pref,0,sizeof(pref)); } } return 0; }