We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

Loading...

- Practice
- Algorithms
- Implementation
- Sequence Equation

# Sequence Equation

# Sequence Equation

You are given a sequence of integers, . Each element in the sequence is distinct and satisfies . For *each* where , find any integer such that and print the value of on a new line.

For example, assume you have the sequence . For each value of between and we analyze as follows:

- , so
- , so
- , so
- , so
- , so

We find the values for .

**Input Format**

The first line contains an integer , the number of elements in the sequence.

The second line contains space-separated integers where .

**Constraints**

- , where .
- Each element in the sequence is distinct.

**Output Format**

For each from to , print an integer denoting any valid satisfying the equation on a new line.

**Sample Input 0**

```
3
2 3 1
```

**Sample Output 0**

```
2
3
1
```

**Explanation 0**

Given the values of , , and , we calculate and print the following values for each from to :

- , so we print the value of on a new line.
- , so we print the value of on a new line.
- , so we print the value of on a new line.