In a very prestigious coding competition, N participants from different part of the country have come to participate. These participants, who have come to display their programming prowers, are split into M teams in some manner. It should be noted that each team has at least one participant. After the competition each pair of participants from the same team became friends.
Your task is to write a program that will find the minimum and the maximum number of pairs of friends that could have formed by the end of the competition.