Arkanium77

Untitled

Jun 5th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. s = 4
  2. a = [0]*s
  3. n = int(input())
  4. for i in range(s):  
  5.    a[i] = int(input())
  6. cnt = 0
  7. n29 = 0
  8. for i in range(s, n):    
  9.     k = i % s  
  10.     if a[k] % 29 == 0:    
  11.         n29 = n29 + 1  
  12.     a_ = int(input())
  13.     if a_ % 29 == 0:    
  14.         cnt = cnt + i - s + 1
  15.     else:        
  16.         cnt = cnt + n29    
  17.     a[i % s] = a_
  18. print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment