Stanislav AlmostRandom 6246 | Бурдюгова Мария, 321 AlmostRandom 6410 | ||||
---|---|---|---|---|---|
f | 1 | import random | f | 1 | import random |
2 | 2 | ||||
3 | def divrandom(a, b, s, p): | 3 | def divrandom(a, b, s, p): | ||
4 | if a > b: | 4 | if a > b: | ||
5 | a, b = (b, a) | 5 | a, b = (b, a) | ||
t | 6 | for _ in range(100): | t | 6 | for i in range(100): |
7 | num = random.randrange(a, b + 1, s) | 7 | el = random.randrange(a, b + 1, s) | ||
8 | if num % p != 0: | 8 | if el % p != 0: | ||
9 | return num | 9 | return el | ||
10 | return 0 | 10 | return 0 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|