Advertisement
Void-voiD

Untitled

Apr 3rd, 2023
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | Source Code | 0 0
  1. a = open('input.txt', 'r')
  2. b = open('output.txt', 'w')
  3. mx = -(10 ** 9)
  4. mn = 10 ** 9
  5.  
  6. for x in a:
  7.     x = int(x)
  8.     if x % 2 == 0 and x > 0:
  9.         if x > mx:
  10.             mx = x
  11.         if x < mn:
  12.             mn = x
  13.  
  14. if mx != -(10 ** 9) and mn != 10 ** 9:
  15.     print(mn, mx, file=b)
  16. else:
  17.     print(0, file=b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement