# Friday puzzle

I decided to support andyshevchenko in the publication of Friday's puzzles, and ask, probably, the most difficult task that I have ever solved.

The king called his 100 sages in the evening and announced that in the morning he would give them a test. If they pass it, he will provide them with gold for the rest of his life; if not, he will execute them all. The king told the sages what the test would be: he will put a hat on each sage, which can be one of 100 colors, each sage does not see what color the hat is on him, but he sees what colors the hats are on his comrades. Sages will be forbidden to communicate. On command, they will have to simultaneously say how they think which hat is on them, and if at least one guesses, then the test is considered passed. They have a night before the test to come up with a strategy. Imagine yourself in the place of the sages, and try to come up with the right strategy

Explanation: each sage has a hat of one color, it is also possible that the colors of the hats of some sages are the same, in addition, the king can wear hats of the same color on all sages. It is only known that there are only 100 colors for hats and they are known.

The king called his 100 sages in the evening and announced that in the morning he would give them a test. If they pass it, he will provide them with gold for the rest of his life; if not, he will execute them all. The king told the sages what the test would be: he will put a hat on each sage, which can be one of 100 colors, each sage does not see what color the hat is on him, but he sees what colors the hats are on his comrades. Sages will be forbidden to communicate. On command, they will have to simultaneously say how they think which hat is on them, and if at least one guesses, then the test is considered passed. They have a night before the test to come up with a strategy. Imagine yourself in the place of the sages, and try to come up with the right strategy

Explanation: each sage has a hat of one color, it is also possible that the colors of the hats of some sages are the same, in addition, the king can wear hats of the same color on all sages. It is only known that there are only 100 colors for hats and they are known.