about summary refs log tree commit diff
path: root/others/other/hinhvuong.py
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-07-11 22:33:40 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-07-11 22:33:40 +0700
commit1ceb9227cb48d50f57343fa42c32815b94855488 (patch)
tree94d34c4a7d679b7e23dec199f0fee8b224c2df7e /others/other/hinhvuong.py
parent1f60c2ea7bf245486e104add6bafe5a34e0b83ae (diff)
downloadcp-1ceb9227cb48d50f57343fa42c32815b94855488.tar.gz
Add others/other/{chonso.py,divseq.c,hinhvuong.py,quacau.c}
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)