zhukov000

example17

Nov 9th, 2021
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. n = 10000
  2. a = [int(input()) for i in range(n)]
  3. mn = 20001
  4. k = 0
  5. for i in range(1, n):
  6.   if (a[i] % 7 == 0 and a[i-1] % 17 != 0) or (a[i] % 17 != 0 and a[i-1] % 7 == 0):
  7.     k += 1
  8.     if a[i] + a[i-1] < mn:
  9.       mn = a[i] + a[i-1]
  10. print(k, mn)
Advertisement
Add Comment
Please, Sign In to add comment