
PROG

(Python)
def play(ps, n, r, i, j):
....if j>=n:
........ps.add(tuple(sorted(r)))
....else:
........(ni, nj) = (i, j+1) if j<(n1) else (i+1, i+2)
........s=list(r)
........s[i]=r[i]+n; play(ps, n, s, ni, nj)
........s[i]=r[i]+1; s[j]=r[j]+1; play(ps, n, s, ni, nj)
........s[i]=r[i] ; s[j]=r[j]+n; play(ps, n, s, ni, nj)
....ps=set()
....play(ps, n, [0]*n, 0, 1)
....return len(ps)
