B. Random Teams
time limit per test
memory limit per test
input
output
n participants of the competition were split into m
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.
Input
n and m, separated by a single space (1 ≤ m ≤ n ≤ 109) — the number of participants and the number of teams respectively.
Output
kmin and kmax
Examples
input
5 1
output
10 10
input
3 2
output
1 1
input
6 3
output
3 6
Note
In the first sample all the participants get into one team, so there will be exactly ten pairs of friends.
In the second sample at any possible arrangement one team will always have two participants and the other team will always have one participant. Thus, the number of pairs of friends will always be equal to one.
2 people, maximum number can be achieved if participants were split on teams of 1, 1 and 4
求最小时,分的平均一点,最大时就只有其他给1,最大的就是这个队,注意范围,超出了int。