diff options
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) |
