Soon after the Chunga-Changa island was discovered, it started to acquire some forms of civilization and even market economy. A new currency arose, colloquially called "chizhik". One has to pay in chizhiks to buy a coconut now.

Sasha and Masha are about to buy some coconuts which are sold at price $z$ chizhiks per coconut. Sasha has $x$ chizhiks, Masha has $y$ chizhiks. Each girl will buy as many coconuts as she can using only her money. This way each girl will buy an integer non-negative number of coconuts.

The girls discussed their plans and found that the total number of coconuts they buy can increase (or decrease) if one of them gives several chizhiks to the other girl. The chizhiks can't be split in parts, so the girls can only exchange with integer number of chizhiks.

Consider the following example. Suppose Sasha has $5$ chizhiks, Masha has $4$ chizhiks, and the price for one coconut be $3$ chizhiks. If the girls don't exchange with chizhiks, they will buy $1 + 1 = 2$ coconuts. However, if, for example, Masha gives Sasha one chizhik, then Sasha will have $6$ chizhiks, Masha will have $3$ chizhiks, and the girls will buy $2 + 1 = 3$ coconuts. 

It is not that easy to live on the island now, so Sasha and Mash want to exchange with chizhiks in such a way that they will buy the maximum possible number of coconuts. Nobody wants to have a debt, so among all possible ways to buy the maximum possible number of coconuts find such a way that minimizes the number of chizhiks one girl gives to the other (it is not important who will be the person giving the chizhiks).


-----Input-----

The first line contains three integers $x$, $y$ and $z$ ($0 \le x, y \le 10^{18}$, $1 \le z \le 10^{18}$) — the number of chizhics Sasha has, the number of chizhics Masha has and the price of a coconut. 


-----Output-----

Print two integers: the maximum possible number of coconuts the girls can buy and the minimum number of chizhiks one girl has to give to the other.


-----Examples-----
Input
5 4 3

Output
3 1

Input
6 8 2

Output
7 0



-----Note-----

The first example is described in the statement. In the second example the optimal solution is to dot exchange any chizhiks. The girls will buy $3 + 4 = 7$ coconuts.

Difficulty: interview

Starter code:

Solutions:
x, y, z = list(map(int, input().split()))
c = x // z + y // z

rx = x % z
ry = y % z
if rx + ry < z:
    print(f'{c} 0')
else:
    if rx > ry:
        print(f'{c + 1} {z - rx}')
    else:
        print(f'{c + 1} {z - ry}')


x,y,z=list(map(int,input().split()))
ans1=x//z +y//z
x=x%z
y=y%z
if (x+y)>=z:
    print(ans1+1,min(z-x,z-y))
else :
    print(ans1,0)


def main():
    x, y, z = map(int, input().split())
    a = x // z + y // z
    x %= z
    y %= z
    if x + y < z:
        print(a, 0)
    else:
        print(a + 1, min(z - x, z - y))
    return 0

main()

x, y, z = map(int, input().split())
a = x % z
b = y % z
s = x // z + y // z
if a + b >= z:
    print(s + 1, min(z - b, z - a))
else:
    print(s, 0)

a, b, c = list(map(int, input().split()))

n = a // c + b // c
m1 = a % c
m2 = b % c

add = 0

if m1 + m2 >= c:
    add = c - max(m1, m2)
    n += 1

print(n, add)


x, y, z = map(int, input().split())

ans = 0
ans2 = 0
ans += x // z 
ans += y // z 
x %= z 
y %= z

if x + y >= z:
  ans += 1
  ans2 = min(z - x, z - y)

print(ans, ans2) 

x,y,z = map(int, input().split())
if x % z == 0 or y % z == 0:
    print(x // z + y // z, 0)
else:
    yy = y % z
    xx = x % z
    if yy + xx >= z:
        print(x // z + y // z + 1, min(z - xx, z - yy))
    else:
        print(x // z + y // z, 0)

x, y, z = list(map(int, input().split()))
can_buy = x // z
can_buy += y // z
x %= z
y %= z
ans = 0
if x + y >= z:
    can_buy += 1
    ans = z - max(x, y)
print("{} {}".format(can_buy, ans))


s, m, cost = list(map(int, input().split()))

cnt = s // cost + m // cost
ost_s = s % cost
ost_m = m % cost

if ost_s + ost_m >= cost:
    print(cnt + 1, min(cost - ost_s, cost - ost_m))
else:
    print(cnt, 0)


x,y,z=map(int,input().split())
print((x+y)//z,end=" ")
a=x%z
b=y%z
if a+b>=z:
    print(z-max(a,b))
else:
    print("0")


x, y, z= map(int,input().split())

tot = (x + y)//z
min1 = -1
if(x//z + y//z == tot):
    min1 = 0
else:
    min1 = min(z - x%z, z - y%z)
print(tot, min1)

x, y, z = map(int, input().split())
a = (x+y)//z
xm = x%z
ym = y%z
if x//z + y//z == a:
    ans = 0
else:
    ans = min(z - xm, z - ym)
print((x+y)//z, ans) 

a, b, c = map(int, input().split())
print((a + b) // c, end = ' ')
if (a % c) + (b % c) >= c:
    print(min((-b) % c, (-a) % c))
else:
    print(0)

import math
from decimal import Decimal
def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return n,b
 
 
def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return n,b,c
 
 
def dv():
	n, m = list(map(int, input().split()))
	return n,m
 
 
def dva():
	n, m = list(map(int, input().split()))
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return n,m,b
 
 
def eratosthenes(n): 
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))
 
 
 
def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return n,b,m,c
 
 
def dvs():
	n = int(input())
	m = int(input())
	return n, m
 

x, y ,z = list(map(int, input().split()))
s1 = x // z + y // z
rz = z - x % z
rz2 = z - y % z
x1 = x + rz
y1 = y - rz
x2 = x - rz2
y2 = y + rz2
s2 = x1 // z + y1 // z
s3 = x2 // z + y2 // z
xx = max(s1, s2, s3)
if xx == s1:
	print(xx, 0)
elif xx == s2 and s2 != s3:
	print(s2, rz)
elif xx == s2 == s3:
	print(s2, min(rz, rz2))
elif xx == s3:
	print(s3, rz2)


x,y,z=map(int, input().split())
print((x+y)//z, end = " ")
if(x//z+y//z==(x+y)//z):
    print(0)
else:
    print(min(z-x%z,z-y%z))


x, y, z = list(map(int, input().split()))
res1 = (x+y)//z
if x//z + y//z < res1:
    res2 = z - max(x%z, y%z)
else:
    res2 = 0
print(res1, res2)
        


x, y, z = list(map(int, input().split()))
a = z - x % z
b = z - y % z
p = (x // z) + (y // z)
q = 0
if a <= y:
    p1 = (x + a) // z + (y - a) // z
    if p1 > p:
        p, q = p1, a
if b < x:
    p2 = (x - b) // z + (y + b) // z
    if p2 > p or (p2 == p and b < q):
        p, q = p2, b
print(p, q)


x,y,z = list(map(int, input().split()))
max_c = (x+y)//z
e_1 = x%z
e_2 = y%z
ex = 0
if((e_1 + e_2) >= z):
	ex = min(z-e_1, z-e_2)
print(max_c, ex)

x,y,z = map(int,input().split())
mod1 = x%z
mod2 = y%z

if (mod1+mod2)>=z:
    print(x//z+y//z+1,z-max(mod1,mod2))
else:
    print(x//z+y//z,0)

r=[int(x) for x in input().split()]
m=r[0]
n=r[1]
z=r[2]

maxNum=(m+n)//z
if (m//z+n//z)==(m+n)//z:
    minSwitch=0
else:
    minSwitch=z-max(m % z, n % z)

print(maxNum,end=" ")
print(minSwitch)

import sys
input = sys.stdin.readline

################################################################################

x, y, z = map(int, input().split())
r = (x+y)//z
t = x//z+y//z
print(r, min(z-x%z, z-y%z) if r != t else 0)

def input_as_list():
    return list(map(int, input().split()))

x, y, z= input_as_list()
n = (x + y) // z

xr, yr = x % z, y % z
if xr + yr >= z:
    d = min(z - xr, z - yr)
else:
    d = 0

print(n, d)