In a $100$ by $100$ grid, there is a spider and $100$ bugs. Each time, the spider can walk up, down, left or right, and the spider aims to visit all the squares with bugs to eat them all. The spider begins from the top-left corner. Show that no matter where the bugs are, the spider can always eat them all within $2000$ steps.
Problem
Source: IMOC 2021 C10
Tags: combinatorics
12.08.2021 20:18
Also 2014 Tournament of Towns Junior.
12.08.2021 20:31
By the way, the bound can be improven to 1853, as one of the official solutions suggests.
20.06.2022 01:11
Let me post the solution. I hope it's correct. We define an $m\times n$ grid have $m$ columns and $n$ rows. We cut the $100\times 100$ grid into $10$ pieces, with each piece being $10\times 100$. Then we cut each piece into $100$ slices, each being $10\times 1$. We consider the worst case, call it the "F is for Fear" scenario. In the F is for Fear, we expect to go through all $1000$ slices. If we move from slice to slice, it will take $1$ step if the two slices is in the same piece, or $10$ step if not. We want to minimize the steps here, so we only move $9$ times with the $10$ step case (it's always possible, even in the F is for Fear). So we will move $990$ times with the $1$ step case. Now in each slice, we would have to eat each food in the slice. In the F is for fear, we would need an average of $9$ step for eating each food. Summing up gives you $900$ steps. This would give you a total of $90+990+900=1980$ steps. PS: I think it can be generalized into all $n\times n$ if $n$ is a perfect square. It guarentees a total of no more than $(n-\sqrt{n})+(n-1)\sqrt{n}+n(\sqrt{n}-1)=(2n-2)\sqrt{n}$. But I don't know how to do it if $n$ is not a perfect square.