Problem 3. The underwater king has octopuses with six, seven, or eight legs in his service. Those with 7 legs always lie, while those with 6 or 8 legs always tell the truth. Four octopuses met. The blue one said: "We have 28 legs in total," the green one: "We have 27 legs in total," the yellow one: "We have 26 legs in total," the red one: "We have 25 legs in total." How many legs does each have?

[5 points] (
Answer: The green octopus has 6 legs, while the others have 7 legs each.

Solution: Since the octopuses contradict each other, there are two possible cases: either all the octopuses are lying, or exactly one of them is telling the truth.

If all the octopuses are lying, then each of them has 7 legs. Therefore, together they have 28 legs. But then the blue octopus would be telling the truth - a contradiction.

If, however, three octopuses lied and one told the truth, then the lying octopuses should have 7 legs each, and the one telling the truth should have either 6 or 8 legs. Therefore, together they would have either 27 or 29 legs, which means the green octopus told the truth.

Thus, the green octopus has 6 legs, and the others have 7 legs each.