```    Program g01slfe
!     G01SLF Example Program Text

!     Mark 26.1 Release. NAG Copyright 2017.

!     .. Use Statements ..
Use nag_library, Only: g01slf, nag_wp
!     .. Implicit None Statement ..
Implicit None
!     .. Parameters ..
Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
Integer                          :: i, ifail, lk, ll, lm, ln, lout
!     .. Local Arrays ..
Real (Kind=nag_wp), Allocatable  :: peqk(:), pgtk(:), plek(:)
Integer, Allocatable             :: ivalid(:), k(:), l(:), m(:), n(:)
!     .. Intrinsic Procedures ..
Intrinsic                        :: max, mod, repeat
!     .. Executable Statements ..
Write (nout,*) 'G01SLF Example Program Results'
Write (nout,*)

!     Skip heading in data file

!     Read in the input vectors
Allocate (n(ln))

Allocate (l(ll))

Allocate (m(lm))

Allocate (k(lk))

!     Allocate memory for output
lout = max(ln,ll,lm,lk)
Allocate (pgtk(lout),plek(lout),peqk(lout),ivalid(lout))

!     Calculate probability
ifail = -1
Call g01slf(ln,n,ll,l,lm,m,lk,k,plek,pgtk,peqk,ivalid,ifail)

If (ifail==0 .Or. ifail==1) Then
!       Display titles
Write (nout,*)                                                         &
'    N         L         M         K       PLEK      PGTK      ',    &
'PEQK    IVALID'
Write (nout,*) repeat('-',78)

!       Display results
Do i = 1, lout
Write (nout,99999) n(mod(i-1,ln)+1), l(mod(i-1,ll)+1),               &
m(mod(i-1,lm)+1), k(mod(i-1,lk)+1), plek(i), pgtk(i), peqk(i),     &
ivalid(i)
End Do
End If

99999 Format (1X,4(I6,4X),3(F6.3,4X),I3)
End Program g01slfe
```