## Task B-2.7.

In the set $A$, there are $m$ consecutive integers whose sum is $2 m$, and in the set $B$, there are $2 m$ consecutive integers whose sum is $m$. The absolute value of the difference between the largest elements of $A$ and $B$ is 99. Determine $m$, and then the sets $A$ and $B$.
## Solution.

Let the set be

$$
\begin{aligned}
& A=a, a+1, a+2, a+3, \ldots, a+m-1 \\
& B=b, b+1, b+2, b+3, \ldots, b+m-1, b+m, \ldots, b+2 m-1
\end{aligned}
$$

We have

$$
\begin{aligned}
& a+a+1+a+2+a+3+\cdots+a+m-1=2 m \\
& b+b+1+b+2+b+3+\cdots+b+m-1+\cdots+b+2 m-1=m \\
& |b+2 m-1-(a+m-1)|=99
\end{aligned}
$$

which means we solve the system of equations

$$
\begin{aligned}
& m a+(1+2+3+\cdots+m-1)=2 m \\
& 2 m b+(1+2+3+\cdots+m-1+\cdots+2 m-1)=m \\
& |b-a+m|=99
\end{aligned}
$$

From the first equation, we get

$$
\begin{aligned}
& m a+\frac{(1+m-1)(m-1)}{2}=2 m \\
& 2 m a+m(m-1)=4 m \\
& a=\frac{5-m}{2}
\end{aligned}
$$

From the second equation of the system, we get

$$
\begin{aligned}
& 2 m b+\frac{(1+2 m-1)(2 m-1)}{2}=m \\
& 4 m b+2 m(2 m-1)=2 m \\
& 4 m b+4 m^{2}=4 m \\
& b=1-m
\end{aligned}
$$

Then from the third equation, we have

$$
\begin{aligned}
& |b-a+m|=99 \\
& \left|1-m-\frac{5-m}{2}+m\right|=99 \\
& |m-3|=198
\end{aligned}
$$

From this, we have $m=201$ or $m=-195$. Since $m>0$, the solution is only $m=201$. Let's check if for this $m$, the numbers $a$ and $b$ are integers.

$$
\begin{array}{ll}
a=\frac{5-201}{2}=-98, b=-200 . & 1 \text { point } \\
A=\{-98,-97,-96,-95, \ldots, 102\}, & \\
B=\{-200,-199,-198,-197, \ldots, 201\} . & 1 \text { point }
\end{array}
$$

## COUNTY COMPETITION IN MATHEMATICS

3rd grade - high school - B variant
February 4, 2015.

## IF A STUDENT HAS A DIFFERENT APPROACH TO SOLVING THE PROBLEM, THE COMMITTEE IS OBLIGED TO GRADE AND EVALUATE THAT APPROACH APPROPRIATELY.