summaryrefslogtreecommitdiff
path: root/071.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 /071.py
parent571164d977f91925c4c76a292f74f5f93d09ae23 (diff)
moved files to higher directory after split to new repositoryHEADtrunk
Diffstat (limited to '071.py')
-rw-r--r--071.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/071.py b/071.py
new file mode 100644
index 0000000..44c38b0
--- /dev/null
+++ b/071.py
@@ -0,0 +1,15 @@
+
+from common import ggt
+import math
+
+limit = 1000000
+
+(n1, d1) = (1, limit)
+
+for d2 in xrange(limit+1):
+ n2 = int(math.floor(float(d2) * 3.0/7.0))
+ if n2*d1 > n1*d2 and ggt(n2, d2) == 1 and d2 != 7:
+ (n1, d1) = (n2, d2)
+
+print n1
+