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.


-----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.

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.

Difficulty: interview

Starter code:

Solutions:
"""
Codeforces Contest 273 Div 2 Problem B

Author  : chaotic_iak
Language: Python 3.3.4
"""

def comb2(n):
    return n*(n-1)//2

def main():
    n,m = read()
    k = n // m
    p = n % m
    mn = p * comb2(k+1) + (m-p) * comb2(k)
    mx = comb2(n-m+1)
    print(mn, mx)

################################### NON-SOLUTION STUFF BELOW

def read(mode=2):
    # 0: String
    # 1: List of strings
    # 2: List of integers
    inputs = input().strip()
    if mode == 0: return inputs
    if mode == 1: return inputs.split()
    if mode == 2: return list(map(int, inputs.split()))

def write(s="\n"):
    if s is None: s = ""
    if isinstance(s, list): s = " ".join(map(str, s))
    s = str(s)
    print(s, end="")

write(main())

n, m = list(map(int, input().split()))

mod = n % m
min_size1 = (n // m)
min_size2 = min_size1 + 1
min_ans = min_size1 * (min_size1 - 1) // 2 * (m - mod)  + min_size2 * (min_size2 - 1) // 2 * mod

max_ans = (n - m + 1) * (n - m) // 2

print(min_ans, max_ans)


n, m = list(map(int, input().split()))


def pa(a):
    return a * (a - 1) // 2

ma = pa(n - m + 1)

t = n % m
mi = pa(n // m) * (m - t) + pa(n // m + 1) * t

print(mi, ma)


n,m = list(map(int,input().split()))
mmax = (n-m)*(n-m+1)//2
mmin = 0
k = n//m
a = n%m
mmin = (k+1)*k*a//2 + (m-a)*k*(k-1)//2
print('{} {}'.format(mmin,mmax))


n, m = [int(i) for i in input().split()]
kmin = 0
kmax = 0
kmin = (m - n % m) * (n // m) * (n // m - 1) // 2 + (n % m) * (n // m + 1) * (n // m) // 2
kmax = (n - m + 1) * (n - m) // 2
print(kmin, kmax)

n, m = list(map(int, input().split()))
print(n % m * (n // m + 1) * (n // m) // 2 + (m - n % m) * (n // m) * (n // m - 1) // 2, (n - m + 1) * (n - m) // 2)


n, m = map(int, input().split())
x = n//m
k = m - n%m
print(k*x*(x-1)//2+(m-k)*(x+1)*x//2, (n-m+1)*(n-m)//2)

n,m=list(map(int,input().split()))

maxx=((n-m+1)*(n-m))//2

x=n//m
minn=(x*(x-1))//2
minn*=m
minn+=x*(n%m)

print(minn,maxx)


def main():
    n, m = [int(i) for i in input().split()]
    
    k = n // m
    n1 = (k + 1) * m - n
    
    minimal = n1 * k * (k - 1) // 2 + (m - n1) * (k + 1) * k // 2
    
    maximal = (n - m + 1) * (n - m) // 2
    
    print(minimal, maximal)


main()


a, b = map(int, input().split())
x = a - b + 1
res1 = (x * (x - 1)) // 2
y = a // b
z = a % b
res2 = (b - z) * ((y * (y - 1) // 2)) + z * (((y + 1) * (y)) // 2)
print( str(res2) + ' ' + str(res1))

n, m = map(int, input().split())
kmin = (n // m + 1) * (n // m) // 2 * (n % m) + (n // m) * (n // m - 1) // 2 * (m - n % m)
kmax = (n - m + 1) * (n - m) // 2
print(kmin, kmax)

n, m = list(map(int, input().split()))
Max = max(0, (n - m + 1) * (n - m) // 2)
Mi = n % m
Ma = m - Mi
Min = Ma * (n // m) * (n // m - 1) // 2 + Mi * (n // m) * (n // m + 1) // 2
print(Min, Max)


n,m=list(map(int,input().split()))


def pogatya(x):
    if x==1:
        return 0
    else:
        return x*(x-1)//2




a=n//m
b=n%m
kmin=(m-b)*pogatya(a)+b*pogatya(a+1)
kmax=pogatya(n-m+1)
print(kmin,kmax)


m, n = map(int, input().split())
k_min = 0
g = m // n
s = m - (m // n) * n
k_min = ((g + 1) * g // 2) * s + (g * (g - 1) // 2) * (n - s)
g = m - (n - 1)
k_max = g * (g - 1) // 2
print(k_min, k_max)

n, m = list(map(int, input().split()))

a, c = divmod(n, m)
b = n - m + 1

print((a * (a - 1) >> 1) * (m - c) + ((a + 1) * a >> 1) * c, b * (b - 1) >> 1)


import sys
f = sys.stdin
#f = open('H:\\Portable Python 3.2.5.1\\test_248B1.txt') 

n, m = map(int, f.readline().strip().split())

k_max = (n-(m-1))*(n-(m-1) - 1)//2

n1 = n // m
n2 = n1 + 1
m2 = n % m 
m1 = m - m2

k_min = m1*(n1)*(n1 - 1) // 2 + m2*(n2)*(n2 - 1) // 2

print(str(k_min) + ' ' + str(k_max))

3
#coding: utf-8

n, m = list(map(int, input().split()))

k1 = (n - m + 1) * (n - m) // 2

div = n // m
mod = n % m

k2 = (m - mod) * div * (div - 1) // 2 + mod * (div + 1) * div // 2

print(min(k1, k2), max(k1, k2))


def ap(n): 
  return n*(n-1)//2

n,m=map(int,input().split())
kmax=ap(n-m+1)
if m==1: kmin=kmax
else: kmin=ap(n//m+1)*(n%m) + ap(n//m)*(m-n%m)
print(kmin, kmax)

n, m = list(map(int, input().split()))
kmin = ((m - n % m)*(n//m)*(n//m - 1))//2 + ((n%m) * (n//m+1) * (n//m))//2
kmax = ((n-m+1)*(n-m))//2
print(int(kmin), int(kmax))


a = input().split()
for i in range(len(a)):
	a[i] = int(a[i])
n = a[0]
m = a[1]
pmin = (n%m)*(n//m+1)*(n//m)//2 + (m-n%m)*(n//m)*(n//m - 1)//2
l = n-m+1
pmax = l*(l-1)//2
print(int(pmin), int(pmax))


n, m = map(int, input().split())
if n == m:
    print(0, 0)
elif n == m+1:
    print(1, 1)
else:
    p = n-m+1
    maxi = p*(p-1)//2
    d = n//m
    if d == 1:
        mini = n - m
    else:
        if n % m:
            d += 1
            remain = d*m-n
            mini = (d-1)*(d-2)//2*remain
            remain = n - remain*(d-1)
            remain //= d
            mini += d*(d-1)//2*remain
        else:
            mini = d*(d-1)//2*m
    print(mini, maxi)

n, m = map(int, input().split())
max = (n - m + 1) * (n - m) // 2
if m == 1:
    tmp = 0
min = (n % m) * (((n // m) * (n // m + 1)) // 2) + (m - n % m) * (((n // m - 1) * (n // m)) // 2)
print(min, end=' ')
print(max)


n, m = list(map(int, input().split()))
d = n // m
ans1 = ((n % m) * (d + 1) * d / 2) + (m - n % m) * d * (d - 1) / 2
ans2 = (n - m + 1) * (n - m) // 2
print(int(ans1), int(ans2))