Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = open('17_4542.txt')
- s = list(map(int, file.readlines()))
- min37 = 10**5
- max73 = -10**5
- for i in range(len(s)):
- if abs(s[i]) % 37 == 0:
- min37 = min(min37, s[i])
- if abs(s[i]) % 73 == 0:
- max73 = max(max73, s[i])
- print(min37, max73)
- #min37 > max73
- count = 0
- min_sum = 10**5
- for i in range(1, len(s)):
- if (max73 < s[i] < min37 and (s[i-1] > min37 or s[i-1] < max73)) or (max73 < s[i-1] < min37 and (s[i] > min37 or s[i] < max73)):
- count += 1
- min_sum = min(min_sum, s[i-1] + s[i])
- print(count, min_sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement