Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- q = int(input())
- s = input()
- a = s.split(" ")
- a = [int(x) for x in a]
- b = [0] * q
- i = 0
- while i < len(a):
- if a[i] % 2 == 0 and (i + 1) % 2 != 0:
- b[i] = 1
- elif a[i] % 2 != 0 and (i + 1) % 2 == 0:
- b[i] = 2
- i += 1
- chetn = -1
- nechetn = -1
- i = 0
- while i < len(b):
- if b[i] == 1:
- if chetn == -1:
- chetn = i
- else:
- chetn = -1
- break
- if b[i] == 2:
- if nechetn == -1:
- nechetn = i
- else:
- nechetn = -1
- break
- i += 1
- if chetn != -1 and nechetn != -1:
- print(chetn + 1, nechetn + 1)
- else:
- print(-1, -1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement