commit 48189cdb564f2a4fc79299202cdd3eee05611a42 Author: Felix C. Stegerman Date: Sat Sep 24 12:51:18 2016 +0200 ... diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b144e43 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/[a-z] + +*~ +*.swp diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..51259e2 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +CXXFLAGS=-Wall -Wextra -std=c++11 +SHELL=bash + +.PHONY: run + +run: + make $$P && { head $$S.in | cut -c-80 ; echo ; \ + time ./$$P < $$S.in ; echo \ + cat $$S.ans ; echo ; \ + diff -Naur <( ./$$P < $$S.in ) $$S.ans ; } + +run_py: + head $$S.in | cut -c-80 ; echo ; \ + time python $$P.py < $$S.in ; echo \ + cat $$S.ans ; echo ; \ + diff -Naur <( python $$P.py < $$S.in ) $$S.ans diff --git a/c.py b/c.py new file mode 100644 index 0000000..bb0f306 --- /dev/null +++ b/c.py @@ -0,0 +1,25 @@ +from __future__ import print_function +import sys + +a = map(int, sys.stdin.readline().split()) +b = map(int, sys.stdin.readline().split()) +c = map(int, sys.stdin.readline().split()) + +def mul(a, b): + x,y = a; z,w = b + return x*z + y*w +def add(a, b): + x,y = a; z,w = b + return (x+z, y+w) +def sub(a, b): + x,y = a; z,w = b + return (x-z, y-w) + +if mul(sub(b, a), sub(c, a)) == 0: + print(*sub(add(c, b), a)) +elif mul(sub(a, b), sub(c, b)) == 0: + print(*sub(add(a, c), b)) +elif mul(sub(b, c), sub(a, c)) == 0: + print(*sub(add(a, b), c)) +else: + print("WTF")