Бикметов Данил, 517 группа SwapFive 1764 | Петрова Наталия, 530 группа SwapFive 965 | ||||
---|---|---|---|---|---|
f | 1 | k = int(input()) | f | 1 | k = int(input()) |
n | 2 | a = k | n | ||
3 | prev = k | 2 | res = k | ||
4 | num = 0 | 3 | num = 0 | ||
n | 5 | b = 1 | n | 4 | p = 1 |
6 | mod = 0 | 5 | mod = 0 | ||
7 | div = 0 | 6 | div = 0 | ||
n | n | 7 | prev_num = k | ||
8 | while a * k != k * 10 ** (b - 1) + a // 10: | 8 | while res * k != k * 10 ** (p - 1) + res // 10: | ||
9 | mod = prev % 10 | 9 | mod = prev_num % 10 | ||
10 | div = prev // 10 | 10 | div = prev_num // 10 | ||
11 | num = mod * k + div | 11 | num = mod * k + div | ||
n | 12 | a += 10 ** b * (num % 10) | n | 12 | res += 10 ** p * (num % 10) |
13 | prev = num | 13 | prev_num = num | ||
14 | b += 1 | 14 | p += 1 | ||
15 | if b > 200: | 15 | if p > 200: | ||
16 | break | 16 | break | ||
t | 17 | print(a) | t | 17 | print(res) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|