about summary refs log tree commit diff
diff options
context:
space:
mode:
-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)