#!/usr/bin/env python3
import random

def gen_lines(n):
  res = []
  for i in range(1,n+1):
    sg = (+1 if i % 2 == 0 else -1)
    res += [(i*40*sg, 800, i*120*sg, -200)]
  return res

with open("data/secret/05-harp.in", "w") as f:
  (sx, sy) = (0, -200)
  (tx, ty) = (0, +200)
  lines = gen_lines(16)

  random.seed(72562435)
  random.shuffle(lines)

  print('{:d}'.format(len(lines)), file=f)
  print('{:d} {:d}'.format(sx, sy), file=f)
  for a, b, c, d in lines:
    print('{:d} {:d} {:d} {:d}'.format(a, b, c, d), file=f)
  print('{:d} {:d}'.format(tx, ty), file=f)

with open("data/secret/06-harp.in", "w") as f:
  (sx, sy) = (0, -200)
  (tx, ty) = (0, +200)
  lines = gen_lines(16)

  random.seed(72562431)
  random.shuffle(lines)

  print('{:d}'.format(len(lines)), file=f)
  print('{:d} {:d}'.format(sx, sy), file=f)
  for a, b, c, d in lines:
    print('{:d} {:d} {:d} {:d}'.format(a, b, c, d), file=f)
  print('{:d} {:d}'.format(tx, ty), file=f)
