# GL6/Sp6, Sum mu = 4: values of the in-box translates R1,R2,R3 on c1..c4, and
# (with L=2) every lattice type in the box t^{-2}O^6.  Direct HNF enumeration.
import sys, time
exec(open('/private/tmp/claude-501/-Users-miltonlin-Projects-Trees/f0f18b89-aa0d-4ce6-93d2-78c269eb7d7d/scratchpad/salvage/S1/engine.py').read())
p = int(sys.argv[1]); L = int(sys.argv[2])
orbits = {'c1': (2, 0, 0), 'c2': (1, 1, 0), 'c3': (2, 1, -1), 'c4': (2, 2, -2)}
if len(sys.argv) > 3:
    orbits = {k: orbits[k] for k in sys.argv[3].split(',')}
R = {'R1': (0, 0, 0, 0, -1, -1), 'R2': (1, 0, 0, -1, -1, -1), 'R3': (1, 1, -1, -1, -1, -1)}
for name, a in orbits.items():
    t0 = time.time()
    cnt = count_types(a, p, lo=[-L]*6, hi=[L]*6, total_d=-sum(a), shift=L, prec=6*L+8)
    print('q=%d box t^{-%d}O^6 orbit %s=%s  (%.1fs)' % (p, L, name, a, time.time()-t0))
    for ty, c in sorted(cnt.items()):
        tag = [k for k, v in R.items() if v == ty]
        inbox = max(ty) <= 1 and min(ty) >= -1
        print('    type', ty, 'count', c, tag[0] if tag else ('in-box' if inbox else ''))
    sys.stdout.flush()
