summaryrefslogtreecommitdiff
path: root/033.py
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2014-08-31 20:21:45 +0200
committerReiner Herrmann <reiner@reiner-h.de>2014-08-31 20:35:09 +0200
commit95341b61b030c9e1290f3b326cb7ec584f543aea (patch)
tree852386fa04d32eb859bca11c0eff7b5ef9e50f00 /033.py
parent571164d977f91925c4c76a292f74f5f93d09ae23 (diff)
moved files to higher directory after split to new repositoryHEADtrunk
Diffstat (limited to '033.py')
-rw-r--r--033.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/033.py b/033.py
new file mode 100644
index 0000000..9575983
--- /dev/null
+++ b/033.py
@@ -0,0 +1,34 @@
+def curious_fraction(a, b):
+ a1 = a/10
+ a2 = a%10
+ b1 = b/10
+ b2 = b%10
+
+ result = 1.0*a/b;
+
+ if a2 == 0 or b2 == 0:
+ return False
+
+ if a1 == b1 and 1.0*a2/b2 == result:
+ return True
+
+ if a1 == b2 and 1.0*a2/b1 == result:
+ return True
+
+ if a2 == b1 and 1.0*a1/b2 == result:
+ return True
+
+ if a2 == b2 and 1.0*a1/b1 == result:
+ return True
+
+ return False
+
+product = 1.0
+
+for a in range(10, 100):
+ for b in range(a+1, 100):
+ if curious_fraction(a, b):
+ product *= 1.0*a/b
+
+print int(1/product)
+