dxnge

23

Oct 21st, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. with open('17(1).txt') as f:
  2.     cnt, minim = 0, float('inf')
  3.     while a := f.readline():
  4.         x = int(a)
  5.         if x % 3 == x % 5:
  6.             for d in (31, 47, 53):
  7.                 if x % d == 0:
  8.                     cnt += 1
  9.                     if minim > x:
  10.                         minim = x
  11.                     break
  12.  
  13. print(cnt, minim)
Advertisement
Add Comment
Please, Sign In to add comment