# your code goes hereimport numpy as np
([(lambda f: (lambda x: f(lambda y: x(x)(y)))(lambda x: f(lambda y: x(x)(y))))(lambda f: lambda (poses, mat): f((poses[1:], mat + np.pad([[1]], ((poses[0][1], mat.shape[0] - poses[0][1] - 1), (poses[0][0], mat.shape[1] - poses[0][0] - 1)))),) if len(poses) > 1 else ([], mat + np.pad([[1]], ((poses[0][1], mat.shape[0] - poses[0][1] - 1), (poses[0][0], mat.shape[1] - poses[0][0] - 1)))))(
[(poses[0] + np.max(np.abs(ls)), poses[1] + np.max(np.abs(ls)))
for x1, y1, x2, y2 in zip(ls[0,:-1], ls[1,:-1], ls[0,1:], ls[1,1:])
for poses in (lambda x1,y1,x2,y2: [(x1, y) for y in range(min(y1, y2), max(y1, y2) + 1)] if x1 == x2
else [(x, y1) for x in range(min(x1, x2), max(x1, x2) + 1)])(x1, y1, x2, y2)],
np.zeros((np.max(np.abs(ls)) * 2 + 1, np.max(np.abs(ls)) * 2 + 1), dtype=np.uint8))
for ls in [(lambda length: np.int8([np.int8([0,2,2] + [(1 if (i // 2) % 2 == 0 else -1) * (i // 4 + 1) * 2 for i in range(2, length)]),
np.int8([(-1 if (i // 2) % 2 == 0 else 1) * (i // 4 + 1) * 2 for i in range(0, length + 1)])]))(5)]][0] != 0) * 1
# array(
# [[0, 0, 1, 1, 1, 1, 1, 1, 1],
# [0, 0, 1, 0, 0, 0, 0, 0, 0],
# [0, 0, 1, 0, 1, 1, 1, 0, 0],
# [0, 0, 1, 0, 0, 0, 1, 0, 0],
# [0, 0, 1, 0, 0, 0, 1, 0, 0],
# [0, 0, 1, 0, 0, 0, 1, 0, 0],
# [0, 0, 1, 1, 1, 1, 1, 0, 0],
# [0, 0, 0, 0, 0, 0, 0, 0, 0],
# [0, 0, 0, 0, 0, 0, 0, 0, 0]])
IyB5b3VyIGNvZGUgZ29lcyBoZXJlaW1wb3J0IG51bXB5IGFzIG5wCgooWyhsYW1iZGEgZjogKGxhbWJkYSB4OiBmKGxhbWJkYSB5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mb3IgbHMgaW4gWyhsYW1iZGEgbGVuZ3RoOiBucC5pbnQ4KFtucC5pbnQ4KFswLDIsMl0gKyBbKDEgaWYgKGkgLy8gMikgJSAyID09IDAgZWxzZSAtMSkgKiAoaSAvLyA0ICsgMSkgKiAyIGZvciBpIGluIHJhbmdlKDIsIGxlbmd0aCldKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5wLmludDgoWygtMSBpZiAoaSAvLyAyKSAlIDIgPT0gMCBlbHNlIDEpICogKGkgLy8gNCArIDEpICogMiBmb3IgaSBpbiByYW5nZSgwLCBsZW5ndGggKyAxKV0pXSkpKDUpXV1bMF0gIT0gMCkgKiAxCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKIyBhcnJheSgKIyAgICAJW1swLCAwLCAxLCAxLCAxLCAxLCAxLCAxLCAxXSwKIyAgICAJWzAsIDAsIDEsIDAsIDAsIDAsIDAsIDAsIDBdLAojICAgICAgIFswLCAwLCAxLCAwLCAxLCAxLCAxLCAwLCAwXSwKIyAgICAgICBbMCwgMCwgMSwgMCwgMCwgMCwgMSwgMCwgMF0sCiMgICAgICAgWzAsIDAsIDEsIDAsIDAsIDAsIDEsIDAsIDBdLAojICAgICAgIFswLCAwLCAxLCAwLCAwLCAwLCAxLCAwLCAwXSwKIyAgICAgICBbMCwgMCwgMSwgMSwgMSwgMSwgMSwgMCwgMF0sCiMgICAgICAgWzAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDBdLAojICAgICAgIFswLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAwXV0p
Traceback (most recent call last):
File "/usr/lib/python3.7/py_compile.py", line 143, in compile
_optimize=optimize)
File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "./prog.py", line 3
([(lambda f: (lambda x: f(lambda y: x(x)(y)))(lambda x: f(lambda y: x(x)(y))))(lambda f: lambda (poses, mat): f((poses[1:], mat + np.pad([[1]], ((poses[0][1], mat.shape[0] - poses[0][1] - 1), (poses[0][0], mat.shape[1] - poses[0][0] - 1)))),) if len(poses) > 1 else ([], mat + np.pad([[1]], ((poses[0][1], mat.shape[0] - poses[0][1] - 1), (poses[0][0], mat.shape[1] - poses[0][0] - 1)))))(
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.7/py_compile.py", line 147, in compile
raise py_exc
py_compile.PyCompileError: File "./prog.py", line 3
([(lambda f: (lambda x: f(lambda y: x(x)(y)))(lambda x: f(lambda y: x(x)(y))))(lambda f: lambda (poses, mat): f((poses[1:], mat + np.pad([[1]], ((poses[0][1], mat.shape[0] - poses[0][1] - 1), (poses[0][0], mat.shape[1] - poses[0][0] - 1)))),) if len(poses) > 1 else ([], mat + np.pad([[1]], ((poses[0][1], mat.shape[0] - poses[0][1] - 1), (poses[0][0], mat.shape[1] - poses[0][0] - 1)))))(
^
SyntaxError: invalid syntax