input""b dim n(b) for g=1to b input""n(g)next for i=1to b for j=1to b-i c=c+1 t=n(j+1) if t