%%HP: T(3)A(R)F(.);
@ VECTPROB by James H. Cloos
DIR
  P\->D
    \<< ARRY\-> EVAL \->LIST DUP SIZE { } \-> A n B
      \<< 0 1 n
        FOR J A J GET + DUP 'B' SWAP STO+
        NEXT DROP B LIST\-> \->ARRY
      \>>
    \>>
  PXYZ
    \<< ROT ROT DUP2 5 ROLL NXYZ SWAP ROT ^ /
    \>>
  PXY
    \<< DUP2 NXY SWAP ROT ^ /
    \>>
  NXYZ
    \<< 1 - 3 PICK OVER - \-> d s n m
      \<< { } 1 s
        FOR J J m ^ J 1 - m ^ - +
        NEXT LIST\-> \->ARRY
        IF n
        THEN n s NXY IBM
        END
      \>>
    \>>
  NXY
    \<< { } + 1 CON SWAP IBP
    \>>
  IBM
    \<< DUP2 SIZE EVAL SWAP SIZE EVAL DUP2 + 1 - 1 \->LIST 0 CON 1 3 ROLL
      FOR I 1 3 PICK
        FOR J DUP I J + 1 - GET 5 PICK I GET 5 PICK J GET * + I J + 1 -
SWAP PUT
        NEXT
      NEXT 4 ROLLD 3 DROPN
    \>>
  IBP
    \<< DUP 1
      IF >
      THEN \-> x y
        \<< x 1 y 1 -
          START x IBM
          NEXT
        \>>
      ELSE DROP
      END
    \>>
END
