Qualifying Contest CodeForces - 659B Very soon Berland will hold a School Team Programming Olympiad. From each of the mBerland regions a team of two people is invited to participate in the olympiad. The qualifying contest to form teams was held and i…