From 1ceb9227cb48d50f57343fa42c32815b94855488 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Tue, 11 Jul 2017 22:33:40 +0700 Subject: Add others/other/{chonso.py,divseq.c,hinhvuong.py,quacau.c} --- others/other/hinhvuong.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 others/other/hinhvuong.py (limited to 'others/other/hinhvuong.py') 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) -- cgit 1.4.1