## A. Era

### Solution:

Just simulation. When we find a certain a[i]>i+ ans, insert the number of a[i]-(i+ ans).

### Code:

Java

C++

## B. XOR Specia-LIS-t

### Solution:

If n is an even number, then we use every single number to be a independent subarray. In this way, an even number of 1s are XORed, and the result must be 0.

If n is an odd number, similarly, we look for $a[i]\geq a[i+1]$, so that when these two numbers are put together, the even number of 1s will be XORed.

### Code:

Java

C++

## C. Di-visible Confusion

### Solution:

Obviously, a[1] must not be divisible by 2, otherwise it must be NO. Because a[1] cannot be deleted by deleting the previous number. Similarly, a[2] can be at least not divisible by one of 2 and 3. And so on.

At the same time, we noticed that if a number is divisible by all the numbers between 2 and x, then this number must be divisible by the least common multiple of 2, 3,..., x.

Therefore, we only need to get the minimal x such that $lcm(2,3,\dots,x)>10^9$.

As long as a[i] can be divisible by a number between 2 and min(x, i). If it can be divided by all of them, it outputs NO.

### Code:

Java

C++

## D. Moderate Modular Mode

### Solution:

According to the relationship between x and y, there are the following situations:

- If x>y, then n=x+y. At this time, n mod x = y mod n = y.
- If x=y, n=x.
- If y>x and y mod x = 0. Then n=x. At this time, n mod x = y mod n = 0.
- If y<x and y mod x $\neq$ 0. At this point, we notice that both x and y are even numbers. Naturally, $n=\frac {\left \lfloor \frac y x \right \rfloor \cdot x + x} 2$.

### Code:

Java

C++

## E. Extreme Extension

The key to this question is to find that for any a[i], there are at most only $\sqrt a[i]$ different ways of possible splits. Taking 100 as an example, it must be impossible to split 100 into 20, 40, and 40. If the final 100 is to be split into 3 numbers, then it must be 33, 33, and 34.

With this, the dp part is easy to think of.