Nine brilliant most students were summoned by an inspecting professor. He gave them a situation and told them that he is having nine hats. The hats are either red colored or blue colored as told by the professor. He also tells them that he have at least one red colored hat and the number of blue hats are greater than the red hats.
He places one hat on each of their heads. The students are not allowed to talk with each other and no means of communication is feasible. He asks them how many hats are blue and how many are red. He gives them half an hour to deduce and moves out of the room. Nobody is able to answer when he returns back and thus he gives them another fifteen minutes. But when he returns, no one can answer again. Thus he gives them final five minutes. On returning back this time, everyone was available with an accurate answer.
How could the students have deduced the right answer? What is the right answer?