Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- a = [int(i) for i in input().split()]
- maxmax = 0
- k = 0
- u = False
- s = 0
- maxs = 0
- f = 0
- maxf = 0
- for i in range(n):
- if a[i] < 5 and not u:
- u = True
- s = i
- if a[i] == 5:
- u = False
- k = 0
- if a[i] < 5 and u:
- k += 5 - a[i]
- if maxmax < k:
- maxmax = k
- maxs = s
- maxf = i
- k = 0
- u = False
- s = 0
- maxs = 0
- f = 0
- maxf = 0
- for i in range(n):
- if a[i] < 5 and not u:
- u = True
- s = i
- if a[i] == 5:
- u = False
- k = 0
- if a[i] < 5 and u:
- k += 5 - a[i]
- if maxmax == k:
- print(s + 1, i + 1, k)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement