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