SHARE
TWEET

Untitled

a guest Oct 12th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = list(map(int, input().split()))
  2. weekends = set(range(6, n[0] + 1, 7)) | set(range(7, n[0] + 1, 7))
  3. meeting = set()
  4. i = 0
  5. while i < n[1]:
  6.     a = list(map(int, input().split()))
  7.     meeting = meeting | set(range(a[0], n[0] + 1, a[1])) - weekends
  8.     i += 1
  9. print(len(meeting))
RAW Paste Data
Top