Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from adventlib import *
- from collections import defaultdict, deque
- import copy
- import re
- def main(f): data = lines_int(f) c, d = data[0], data[1]
- # c, d = 5764801, 17807724
- v = 1
- i = 0
- while v != c:
- v *= 7
- v %= 20201227
- i += 1
- v = 1
- i2 = 0
- while v != d: v *= 7 v %= 20201227 i2 += 1
- print(i, i2)
- v = 1
- for _ in range(i2):
- v *= c
- v %= 20201227
- print(v)
- run_main(main)
Advertisement
Add Comment
Please, Sign In to add comment