about summary refs log tree commit diff
path: root/others/other/hinhvuong.py
diff options
context:
space:
mode:
Diffstat (limited to 'others/other/hinhvuong.py')
-rwxr-xr-xothers/other/hinhvuong.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/others/other/hinhvuong.py b/others/other/hinhvuong.py
new file mode 100755
index 0000000..8e3891a
--- /dev/null
+++ b/others/other/hinhvuong.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+with open('HINHVUONG.INP') as fi, open('HINHVUONG.OUT', 'w') as fo:
+    A, B, C, D = sorted([int(i) for i in s.split()] for s in fi.readlines())
+    if A[0] != B[0] or C[0] != D[0] or A[1] != C[1] or B[1] != D[1]:
+        fo.write('-1\n')
+    else:
+        print((B[0]-C[0]) ** 2, file=fo)