How many squares with sides along the grid lines can be drawn on an $8 \times 8$ board?

#
Squares of $1 \times 1$ can be drawn 64. Squares of $2 \times 2$ can be drawn 49 (take the square in the top right corner and first slide it along the top strip - this gives seven squares, and then all these squares can be moved down seven times). Squares of $3 \times 3$ can be drawn 36, and so on. The total number of squares is $64+49+36+25+16+9+4+1=204$.

In Old Kalitva, there are 50 schoolchildren, and in Middle Boltai - 100 schoolchildren. Where should a school be built to minimize the total distance traveled by all schoolchildren?

## Solution

Let's take 50 schoolchildren from Old Kalitva and 50 schoolchildren from Middle Boltai and pair them up, with one schoolchild from each city in each pair. For each such pair, the distance they travel to school does not depend on the location of the school (of course, it should be built somewhere on the road between the cities), but there are still 50 schoolchildren left in Middle Boltai. Therefore, to minimize the total distance traveled by all schoolchildren, the school should be built in Middle Boltai.

## Answer

In Middle Boltai.