First Index And Last Index

easy
1. You are given a number n, representing the size of array a.
2. You are given n numbers, representing elements of array a.

Asssumption - Array is sorted. Array may have duplicate values.

Input Format

A number n n1 n2 .. n number of elements A number d

Output Format

A number representing first index A number representing last index

Constraints

1 <= n <= 1000
1 <= n1, n2, .. n elements <= 100
1 <= d <= 100

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
15
1
5
10
15
22
33
33
33
33
33
40
42
55
66
77
33
Output
5
9
Previous
Broken Economy
Next
Inverted Bar Chart

Related Questions