code 34604;
procedure HESTGL2(N,A,B);value N;integer N;array A,B;
begin integer NM1,K,L,K1,L1;
    if N>2 then 
    begin for K:=2 step 1 until N do 
        for L:=1 step 1 until K-1 do B[K,L]:=0;
        NM1:=N-1;K:=1;
        for K1:= 2 step 1 until NM1 do 
        begin L1:=N;
            for L:=N-1 step -1 until K1 do 
            begin 
                HSH2COL(K,L,N,L,A[L,K],A[L1,K],A,B);A[L1,K]:=0;
                HSH2ROW2(1,1,N,L1,L,B[L1,L1],B[L1,L],A,B);
                B[L1,L]:=0;L1:=L
            end;K:=K1
        end 
    end 
end HESTGL2;
        eop