Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('17.txt') as f:
- cnt, minim, maxim = 0, float('inf'), float('-inf')
- while a := f.readline():
- x = int(a)
- b = 0
- for d in (2, 3, 5, 7):
- if x % d == 0:
- b += 1
- if b == 2:
- cnt += 1
- if minim > x:
- minim = x
- if maxim < x:
- maxim = x
- print(cnt, minim + maxim)
Advertisement
Add Comment
Please, Sign In to add comment