dxnge

8

Oct 27th, 2021
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. with open('8.txt') as f:
  2.     f_cnt, s_cnt = 0, 0
  3.     cnt = 0
  4.     while a := f.readline().split():
  5.         frst, snd = int(a[0]), int(a[1])
  6.         for d in (3, 7, 13, 23, 50):
  7.             if frst % d == 0:
  8.                 f_cnt += 1
  9.             if snd % d == 0:
  10.                 s_cnt += 1
  11.             if f_cnt == s_cnt:
  12.                 cnt += 1
  13.             f_cnt, s_cnt = 0, 0
  14. print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment