\START92\ \COMMENT=Single file dated Fri Dec 19 22:13:14 20 \NAME=part2 \FILE=day5.part2.92f (rs) Func Local i,j,lowerb,upperb,dimb mat\to\list(rs[1])\->\lowerb mat\to\list(rs[2])\->\upperb dim(lowerb)\->\dimb For i,dimb,1,\(-)\1 For j,dimb,i+1,\(-)\1 If lowerb[i]\>=\lowerb[j] and upperb[i]\<=\upperb[j] Then lowerb[dimb]\->\lowerb[i] upperb[dimb]\->\upperb[i] dimb-1\->\dimb Exit ElseIf lowerb[j]\>=\lowerb[i] and upperb[j]\<=\upperb[i] Then lowerb[dimb]\->\lowerb[j] upperb[dimb]\->\upperb[j] dimb-1\->\dimb EndIf EndFor EndFor left(lowerb,dimb)\->\lowerb left(upperb,dimb)\->\upperb For i,1,dimb For j,i+1,dimb If upperb[i]\>=\lowerb[j] and upperb[i]\<=\upperb[j] Then lowerb[j]-1\->\upperb[i] ElseIf lowerb[i]\>=\lowerb[j] and lowerb[i]\<=\upperb[j] Then upperb[j]+1\->\lowerb[i] EndIf EndFor EndFor sum(upperb-lowerb+1) EndFunc \STOP92\