Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open('1.txt')
- n = int(f.readline())
- k3 = k7 = k21 = 0
- for i in range(n):
- x = int(f.readline())
- if x % 21 == 0:
- k21 +=1
- elif x % 7 == 0:
- k7 +=1
- elif x % 3 == 0:
- k3 +=1
- s =(n*(n-1)//2) -(k3*k7 + k21*(n-k21)+k21*(k21-1)//2)
- print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement