In the first example the air routes form the following tree:
If the people are in the islands and , then islands and will be good.
The sum of the distances from island or to all the people is , which is the minimal. While the sum of the distances from island to all the people is , which is greater than .
Like this, when the people are in island and , then islands and will be good.
When the people are in islands and , then islands and will be good.
When the people are in islands and , then islands and will be good.
When the people are in islands and , then islands and will be good.
When the people are in islands and , then islands and will be good.
So the expect of the number of the good islands is , which equals to modulo .
题解
对于原题提示中的“So the expect of the number of the good islands is , which equals to modulo ”一开始不理解,后来通过查阅资料了解到有限域除法的概念解决了此问题,同时加深了对之前学的乘法逆元的理解。