2. The sum of the absolute values of the terms of a finite arithmetic progression is 100. If all its terms are increased by 1 or all its terms are increased by 2, then in both cases the sum of the absolute values of the terms of the resulting progression will also be equal to 100. What values can the quantity $n^{2} d$ take under these conditions, where $d$ is the common difference of the progression, and $n$ is the number of its terms?
2. Let's denote the sum of the absolute values of the terms of an arithmetic progression by $S(S=100$ in version A and $S=250$ in version B). We will show that $n^{2} d=4 S$, if the given progression $a_{1}, a_{2}, \ldots, a_{n}$ is increasing (for a decreasing progression, the solution is analogous and $n^{2} d=-4 S$). From the problem statement, it follows that the function

$$
S(x)=\left|a_{1}-x\right|+\left|a_{2}-x\right|+\ldots+\left|a_{n}-x\right|
$$

takes the same value at three different points: $S(0)=S(-1)=S(-2)=S$. It is not difficult to verify that

$$
S(x)= \begin{cases}-n x+\text { const } & \text { for } x \leqslant a_{1}, \\ (2 i-n) x+\text { const } & \text { for } a_{i} \leqslant x \leqslant a_{i+1}, 1 \leqslant i \leqslant n-1, \\ n x+\text { const } & \text { for } x \geqslant a_{n} .\end{cases}
$$

Let $n=2 k+1$ be odd, then $S(x)$ decreases for $x \leqslant a_{k+1}$ and increases for $x \geqslant a_{k+1}$, so this function cannot take three identical values.

Let $n=2 k$ be even, then $S(x)$ decreases for $x \leqslant a_{k}$, is constant on the interval $\left[a_{k} ; a_{k+1}\right]$, and increases for $x \geqslant a_{k+1}$. Therefore, $S=S\left(a_{k}+\frac{d}{2}\right)$.

Recall now that our sequence is an arithmetic progression, so $a_{k}-a_{i}=(k-i) d$, and

$$
\begin{array}{r}
S\left(a_{k}+\frac{d}{2}\right)=\left|-(k-1) d-\frac{d}{2}\right|+\left|-(k-2) d-\frac{d}{2}\right|+\ldots \\
\ldots+\left|-\frac{d}{2}\right|+\left|\frac{d}{2}\right|+\ldots+\left|(k-1) d+\frac{d}{2}\right|= \\
=d((2 k-1)+(2 k-3)+\ldots+1)=k^{2} d=\frac{n^{2} d}{4}
\end{array}
$$