From 4b9d9a7068da292ca53fc85a30c65140683ce59d Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sat, 14 May 2011 22:13:06 +0300 Subject: still working on b --- 2010/1c/b/b.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to '2010/1c/b/b.py') diff --git a/2010/1c/b/b.py b/2010/1c/b/b.py index 7bc039a..ffe4d41 100644 --- a/2010/1c/b/b.py +++ b/2010/1c/b/b.py @@ -1,13 +1,19 @@ -f = open('1.in', 'r') -o = open('1.out', 'w') +f = open('2.in', 'r') +o = open('2.out', 'w') T = int(f.readline().strip()) for t in xrange(T): - (n, m, o) = map(int, f.readline().strip().split(' ')) - l = f.readline().strip() + (l, p, c) = map(int, f.readline().strip().split(' ')) + + res = 0 + if p / l != c: + exp = 2 + res += 1 + while l * (c**exp) < p: + exp *= 2 + res += 1 - res = str(n) + str(m) + str(o) + l s = "Case #%d: %s\n" % (t+1, res) print s - #o.write(s) + o.write(s) -- cgit v1.3.1