Codeforces Round 273 (Div. 2)
B
Random Teams
Codeforces
1300
原题
← AC →
翻译中…

$*n*$ participants of the competition were split into $*m*$ teams in some manner so 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.

翻译中…

Input

翻译中…

The only line of input contains two integers $*n*$ and $*m*$, separated by a single space ($1 ≤ *m* ≤ *n* ≤ 10^{9}$) — the number of participants and the number of teams respectively.

翻译中…

Output

翻译中…

The only line of the output should contain two integers $*k*_{*min*}$ and $*k*_{*max*}$ — the minimum possible number of pairs of friends and the maximum possible number of pairs of friends respectively.

翻译中…

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.

翻译中…

In the third sample minimum number of newly formed friendships can be achieved if participants were split on teams consisting of $2$ people, maximum number can be achieved if participants were split on teams of $1$, $1$ and $4$ people.

翻译中…

样例

Input #1
5 1
Output #1
10 10
InputCopy OutputCopy
Input #2
3 2
Output #2
1 1
InputCopy OutputCopy
Input #3
6 3
Output #3
3 6
InputCopy OutputCopy
题目信息
题号
478B
时间限制
1 s
内存限制
256 MB
标签
组合数学
构造
贪心
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。