An append-only event log stores timestamps in a single list sorted in non-decreasing order (the same timestamp may repeat). Given a target timestamp x, report the first and the last 0-indexed positions at which x appears. If x does not appear at all, report -1 -1.
Input format
Line 1: an integer n, the number of timestamps.
Line 2: n space-separated integers in non-decreasing order.
Line 3: an integer x, the target timestamp.
Output format
Two space-separated integers on one line: the first and last 0-indexed positions of x, or -1 -1 if x is absent.
Constraints
- 1 <= n <= 100000
- -1000000000 <= each timestamp, x <= 1000000000
- The timestamps are given in non-decreasing order.