In a highly esteemed coding competition, there are N participants who have come from various parts of the country to showcase their programming skills. These participants are divided into M teams in some manner. It is important to note that each team consists of at least one participant. After the competition, every pair of participants from the same team becomes friends.
Your task is to develop a program that can determine the minimum and maximum number of friend pairs that could have formed by the end of the competition.