Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('8.txt') as f:
- f_cnt, s_cnt = 0, 0
- cnt = 0
- while a := f.readline().split():
- frst, snd = int(a[0]), int(a[1])
- for d in (3, 7, 13, 23, 50):
- if frst % d == 0:
- f_cnt += 1
- if snd % d == 0:
- s_cnt += 1
- if f_cnt == s_cnt:
- cnt += 1
- f_cnt, s_cnt = 0, 0
- print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment