#include #include using namespace std; using namespace atcoder; signed main(){ int N,Q,b; scanf("%d%d%d",&N,&Q,&b); fenwick_tree tree(200001); for(;N--;){ scanf("%d",&b); tree.add(b,1LL); tree.add(b,b*1000001LL); } bool check=false; for(;Q--;){ scanf("%d",&b); if(b==3){ scanf("%d",&b); continue; } if(b==2){ check=true; int l,r; scanf("%d%d",&l,&r); long long ans=tree.sum(l,r+1); printf("%lld %lld\n",ans%1000001LL,ans/1000001LL); continue; } long long l; scanf("%lld",&l); tree.add(l,1LL); tree.add(l,l*1000001LL); } if(!check){ printf("Not Find!\n"); } }