diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2011-05-14 22:13:06 +0300 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2011-05-14 22:13:06 +0300 |
| commit | 4b9d9a7068da292ca53fc85a30c65140683ce59d (patch) | |
| tree | 4f229bcbdf2d8a9daa8dc4a52c53d20847128c2b /2010/1c/b/b.py | |
| parent | 184b3fa19de3ad4bb5f8a155ce9b0e931088207d (diff) | |
still working on b
Diffstat (limited to '2010/1c/b/b.py')
| -rw-r--r-- | 2010/1c/b/b.py | 18 |
1 files changed, 12 insertions, 6 deletions
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) |
