RT。
#include <bits/stdc++.h>
#define gc getchar()
#define pc(c) putchar(c)
#define int long long
using namespace std;
const int N=200007,BC=1013;
int n,a[N];
int blen,bc,bl[BC],br[BC],pos[N];
int stp[N],nxt[N];
struct Res{
int pos,stp;
};
inline int read(){
register int t=0,f=1;
register char c=gc;
while(c!='-'&&(c<'0'||c>'9')) c=gc;
if(c=='-') c=gc,f=-1;
while(c>='0'&&c<='9') t=10*t+(c^48),c=gc;
return f*t;
}
inline void write(int x){
if(!x) return (void)pc('0');
if(x<0) pc('-'),x=-x;
static char c[23]={""};
static int cc=0;
while(x) c[++cc]=x%10,x/=10;
while(cc) pc(c[cc--]|48);
}
inline void buildblock(int i){
for(int j=br[i];j>=bl[i];--j){
if(j+a[j]>n){
stp[j]=1;
nxt[j]=0;
}
else if(pos[j+a[j]]!=i){
stp[j]=1;
nxt[j]=j+a[j];
}
else{
stp[j]=stp[j+a[j]]+1;
nxt[j]=nxt[j+a[j]];
}
}
}
inline void build(){
blen=(int)(sqrt(n));
bc=n/blen;
if(bc*blen<n) ++bc;
for(int i=1;i<=bc;++i){
bl[i]=(i-1)*blen+1,
br[i]=i*blen;
}
br[bc]=n;
for(int i=1;i<=bc;++i){
for(int j=bl[i];j<=br[i];++j){
pos[j]=i;
}
}
for(int i=bc;i>=1;--i){
buildblock(i);
}
}
inline void modify(int k,int v){
a[k]=v;
buildblock(pos[k]);
}
inline Res query(int k){
int x=k,p=0,c=0;
while(pos[x]!=bc&&x!=0){
p=x;
c+=stp[x];
x=nxt[x];
}
if(x==0) x=n+1;
while(x<=n){
p=x;
++c;
x+=a[x];
}
return Res{p,c};
}
signed main(){
static int m;
n=read();
m=read();
for(int i=1;i<=n;++i) a[i]=read();
build();
while(m--){
switch(read()){
int j,k;
case 0:{
j=read(),k=read();
modify(j,k);
break;
}
case 1:{
j=read();
Res t=query(j);
write(t.pos),pc(' ');
write(t.stp),puts("");
break;
}
}
}
return 0;
}