SHARE
TWEET

Untitled

a guest Dec 11th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. s = list(map(int, input().split()))
  2. year = int(s[0])
  3. count = int(s[1])
  4. s = set()
  5. for i in range(count):
  6.     a = input().split()
  7.     first_day = int(a[0])
  8.     dlit = int(a[1])
  9.     s |= set([i for i in range(first_day, year + 1, dlit)])
  10. s_1 = []
  11. for i in s:
  12.     if (i % 7 != 0) & ((i + 1) % 7 != 0):
  13.         s_1.append(i)
  14. print(len(s_1))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top