A. Holiday Of Equality time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output In Berland it is the holiday of equality. In honor of the holiday the king decided to equalize the welfare of all citi…