C
      SUBROUTINE HSR1(A,LA,N)
      INTEGER I,J,K,L,LA,M,N
      REAL A(LA,1),S
      A(1,1) = 1.
      IF ( N .EQ. 1 ) RETURN
      A(1,2) = 0.
      IF ( N .GT. 2 ) GOTO 10
      A(2,1) = 0.
      A(2,2) = 1.
      RETURN
10    L = N - 2
      M = N - 1
      K = N
      S = A(K,L)
      A(N,N) = 1. - S*A(N,L)
      A(M,N) = -S*A(M,L)
20    J = M
      M = L
      L = L - 1
      IF ( L .EQ. 0 ) GOTO 50
      S = 0.
      DO 30 I = J,N
30         S = S + A(I,L)*A(I,K)
      A(M,K) = -S*A(M,L)
      DO 40 I = J,N
40         A(I,K) = A(I,K) - S*A(I,L)
      GOTO 20
50    A(1,K) = 0.
      K = K - 1
      M = K
      L = K - 1
      S = -A(M,L)
      DO 60 I = K,N
60          A(I,K) = S*A(I,L)
      A(K,K) = 1. + A(K,K)
      IF ( L .GT. 1 ) GOTO 20
      DO 70 I = 2,N
70         A(I,1) = 0.
      RETURN
      END