# Task № 6.1

## Condition:

Yasha and Grisha are playing a game: first, they take turns naming a number from 1 to 105 (Grisha names the number first, the numbers must be different). Then each counts the number of different rectangles with integer sides, the perimeter of which is equal to the named number. The one with the greater number of rectangles wins. What number should Grisha name to win? Rectangles that differ only by rotation are considered the same. For example, rectangles $2 \times 3$ and $3 \times 2$ are the same.
# Answer: 104

## Exact match of the answer -1 point

## Solution.

We will show that by naming the number 104, Grisha will win. Consider a rectangle with sides a and b. Its perimeter \( P = 2(a + b) \Rightarrow (a + b) = P / 2 \), then the length of the smaller side can take integer values from 1 to the integer part of the number \( P / 4 \), that is, for the chosen number \( P \), the number of different rectangles with such a perimeter and integer sides is equal to the integer part of the number \( P / 4 \). Note also that \( P \) is even, since it equals \( 2(a + b) \), where \( a \) and \( b \) are integers. For \( P = 104 \), the number of rectangles is 26. Yasha cannot name a number greater than 104, and for \( P \leq 102 \), the number of rectangles is no more than 25. Therefore, Grisha will definitely win.