about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-01-21 11:22:06 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-01-21 11:22:06 +0700
commit5f2a005ffd5052902a0c62c1c4c8f90eb1011fc3 (patch)
treeb56ebe2537aebca092d88621f1cbc649aad6e858
parent6750cd9d0a92f9f5ef544ea9f13ae3419769fb3b (diff)
downloadcp-5f2a005ffd5052902a0c62c1c4c8f90eb1011fc3.tar.gz
Add others/153x/030.py
-rw-r--r--others/153x/005.c (renamed from others/153x/fibistr.c)0
-rw-r--r--others/153x/006.c (renamed from others/153x/circle.c)0
-rwxr-xr-xothers/153x/030.py19
3 files changed, 19 insertions, 0 deletions
diff --git a/others/153x/fibistr.c b/others/153x/005.c
index e3e55d8..e3e55d8 100644
--- a/others/153x/fibistr.c
+++ b/others/153x/005.c
diff --git a/others/153x/circle.c b/others/153x/006.c
index 4d8947f..4d8947f 100644
--- a/others/153x/circle.c
+++ b/others/153x/006.c
diff --git a/others/153x/030.py b/others/153x/030.py
new file mode 100755
index 0000000..f08d0d0
--- /dev/null
+++ b/others/153x/030.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+
+with open("CUT.INP") as f:
+    m, n = map(int, f.readline().split())
+
+squares = []
+while m - n:
+    if m > n:
+        m -= n
+        squares.append("{} 1 {}\n".format(m + 1, n))
+    else:
+        n -= m
+        squares.append("1 {} {}\n".format(n + 1, m))
+squares.append("1 1 {}\n".format(m))
+
+with open("CUT.OUT", "w") as f:
+    f.write("{}\n".format(len(squares)))
+    for i in squares:
+        f.write(i)