ll@n,d[2d5]{},e[1d3],b=0; rep(n){ ll@a; ll m=Divisor(a,e); ll x=max[j,0,m](d[e[j]])+1; d[a]=x; b>?=x; } wt(b);