Professor Snape has just finished marking the final exam papers and wants to know whether the distribution of grades is satisfactory.
He first sorted all the papers by grade, then took the highest and the lowest mark and computed their average. Call this number A. Next he computed the average of all the grades. Call this number B. He considers the distribution satisfactory if and only if the absolute difference between A and B is less than 1.
Write a program that helps Professor Snape.