The final match of the Berland Football Cup has been held recently. The referee has shown $n$ yellow cards throughout the match. At the beginning of the match there were $a_1$ players in the first team and $a_2$ players in the second team.

The rules of sending players off the game are a bit different in Berland football. If a player from the first team receives $k_1$ yellow cards throughout the match, he can no longer participate in the match — he's sent off. And if a player from the second team receives $k_2$ yellow cards, he's sent off. After a player leaves the match, he can no longer receive any yellow cards. Each of $n$ yellow cards was shown to exactly one player. Even if all players from one team (or even from both teams) leave the match, the game still continues.

The referee has lost his records on who has received each yellow card. Help him to determine the minimum and the maximum number of players that could have been thrown out of the game.


-----Input-----

The first line contains one integer $a_1$ $(1 \le a_1 \le 1\,000)$ — the number of players in the first team.

The second line contains one integer $a_2$ $(1 \le a_2 \le 1\,000)$ — the number of players in the second team.

The third line contains one integer $k_1$ $(1 \le k_1 \le 1\,000)$ — the maximum number of yellow cards a player from the first team can receive (after receiving that many yellow cards, he leaves the game).

The fourth line contains one integer $k_2$ $(1 \le k_2 \le 1\,000)$ — the maximum number of yellow cards a player from the second team can receive (after receiving that many yellow cards, he leaves the game).

The fifth line contains one integer $n$ $(1 \le n \le a_1 \cdot k_1 + a_2 \cdot k_2)$ — the number of yellow cards that have been shown during the match.


-----Output-----

Print two integers — the minimum and the maximum number of players that could have been thrown out of the game.


-----Examples-----
Input
2
3
5
1
8

Output
0 4

Input
3
1
6
7
25

Output
4 4

Input
6
4
9
10
89

Output
5 9



-----Note-----

In the first example it could be possible that no player left the game, so the first number in the output is $0$. The maximum possible number of players that could have been forced to leave the game is $4$ — one player from the first team, and three players from the second.

In the second example the maximum possible number of yellow cards has been shown $(3 \cdot 6 + 1 \cdot 7 = 25)$, so in any case all players were sent off.

Difficulty: interview

Starter code:

Solutions:
a1=int(input())
a2=int(input())
k1=int(input())
k2=int(input())
n=int(input())
ans1=0
ans2=0

if k1<k2:
    ans1+=min(n//k1,a1)
    ans1+=(n-ans1*k1)//k2
else :
    ans1+=min(n//k2,a2)
    ans1+=(n-ans1*k2)//k1
ans2=max(0,n-(k1-1)*a1-(k2-1)*a2)
print(ans2,ans1)


a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())
ans1 = n
ans2 = 0
for i in range(a1 + 1):
  for j in range(a2 + 1):
    if (n >= i * k1 + j * k2 and n <= i * k1 + (k1 - 1) * (a1 - i) + j * k2 + (k2 - 1) * (a2 - j)):
      ans1 = min(ans1, i + j)
      ans2 = max(ans2, i + j)
print(ans1, ans2)


def main():
    import sys
    input = sys.stdin.readline
    
    a1 = int(input())
    a2 = int(input())
    k1 = int(input())
    k2 = int(input())
    n = int(input())
    
    mi = max(0, (a1 + a2) - (a1 * k1 + a2 * k2 - n))
    # mi = a1 + a2 - (a1 * k1 + a2 * k2 - n)
    if k1 > k2:
        a1, a2 = a2, a1
        k1, k2 = k2, k1
    ma = 0
    if n >= a1 * k1:
        n -= a1 * k1
        ma += a1
        ma += n // k2
    else:
        ma = n // k1
    
    print(mi, ma)
    
    return 0

main()


from math import *
from bisect import *

a1=int(input())
a2=int(input())
k1=int(input())
k2=int(input())
n=int(input())
maxx,minn=0,1230120
if(k1<k2):
    if(n//k1>a1):
        maxx+=a1
        maxx+=min(((n-k1*a1)//k2), a2)
    else:
        maxx+=(n//k1)
else:
    if(n//k2>a2):
        maxx+=a2
        maxx+=min(((n-k2*a2)//k1), a1)
    else:
        maxx+=(n//k2)

n-=(k1-1)*a1+(k2-1)*a2
if(n<=0):
    minn=0
else:
    minn=n
print(minn,maxx)
                


a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())

if k1 > k2:
    (a1, a2) = (a2, a1)
    (k1, k2) = (k2, k1)

lim = (k1 - 1) * a1 + (k2 - 1) * a2
mini = 0
maxi = 0
if n > lim:
    mini = n - lim

if n >= k1 * a1:
    n -= k1 * a1
    maxi += a1
else:
    rem = n // k1
    maxi += rem
    n -= rem * k1

rem = n // k2
maxi += rem

print(mini, maxi)


a1, a2, k1, k2, n = (int(input()) for _ in range(5))

max_0 = a1*(k1 - 1) + a2*(k2 - 1)
min_count = max(n - max_0, 0)

if k1 < k2:
    if n <= a1 * k1:
        max_count = n//k1
    else:
        max_count = a1 + (n - a1*k1)//k2
else:
    if n <= a2 * k2:
        max_count = n//k2
    else:
        max_count = a2 + (n - a2*k2)//k1

print(min_count, max_count)



a1=int(input())
a2=int(input())
k1=int(input())
k2=int(input())
n=int(input())

t=n
t-=a1*(k1-1)
t-=a2*(k2-1)

if(t<=0):
	print(0,end=" ")
else:
	print(t,end=" ")

t=n
ans=0
if(k1<k2):
	while(t>=k1 and a1>0):
		t-=k1
		a1-=1
		ans+=1

	while(t>=k2 and a2>0):
		t-=k2
		a2-=1
		ans+=1

else:
	while(t>=k2 and a2>0):
		t-=k2
		a2-=1
		ans+=1

	while(t>=k1 and a1>0):
		t-=k1
		a1-=1
		ans+=1

print(ans)






a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())

p = a1 * (k1 - 1) + a2 * (k2 - 1)
if p >= n:
    print(0, end = ' ')
else:
    print( n - p, end = ' ')
s = 0
if k1 > k2:
    g = n // k2
    if g > a2:
        s += a2
        g = n - a2 * k2
        s += g // k1
        print(s)
    else:
        print(g)
else:
    g = n // k1
    if g > a1:
        s += a1
        g = n - a1 * k1
        s += g // k2
        print(s)
    else:
        print(g)


def mx(a1, a2, k1, k2, n):
    fst = min(n // k1, a1)
    n -= fst * k1
    scd = min(n // k2, a2)
    return fst + scd


def mn(a1, a2, k1, k2, n):
    n -= a1 * (k1 - 1) + a2 * (k2 - 1)
    return max(n, 0)


a1, a2, k1, k2, n = [int(input()) for _ in range(5)]
if k1 > k2:
    a1, a2 = a2, a1
    k1, k2 = k2, k1
print(mn(a1, a2, k1, k2, n), mx(a1, a2, k1, k2, n))


a = int(input())
b = int(input())
x = int(input())
y = int(input())
n = int(input())
no = a*(x-1) + b*(y-1)
mn = 0
if n > no:
    mn = n-no
d = min(x,y)
e = max(x,y)
mx = 0
p = 0
q = 0
if d == x:
    p = a
    q = b
else:
    p = b
    q = a
if n <= p*d:
    mx = n//d
else:
    mx = (n-p*d)//e
    mx += p
print(mn,mx)

a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())

minicards = ((k1-1)*a1) + ((k2-1)*a2)
ans = [0,0]

ans[0] = max(n-minicards,0)

if k1>k2:
    ans[1] += min(n//k2,a2)
    n -= min(n//k2,a2) * k2

    ans[1] += min(n//k1,a1)
    n -= min(n//k1,a1) * k1
else:
    ans[1] += min(n//k1,a1)
    n -= min(n//k1,a1) * k1

    ans[1] += min(n//k2,a2)
    n -= min(n//k2,a2) * k2

print(*ans)


import math
import sys
import collections


# imgur.com/Pkt7iIf.png

def getdict(n):
    d = {}
    if type(n) is list:
        for i in n:
            if i in d:
                d[i] += 1
            else:
                d[i] = 1
    else:
        for i in range(n):
            t = ii()
            if t in d:
                d[t] += 1
            else:
                d[t] = 1
    return d
def sieve(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    prime[0] = prime[1] = False
    r = [p for p in range(n + 1) if prime[p]]
    return r
def cdiv(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep = ' '): print(sep.join(map(str, a)))

a = ii()
b = ii()
ka = ii()
kb = ii()
n = ii()
t = a*(ka - 1)
e = b*(kb - 1)
r = min(max(0, n - e - t), a+b)
if ka > kb:
    t = min(b, n//kb)
    n -= t*kb
    t+= min(a, n//ka)
else:
    t = min(a, n // ka)
    n -= t * ka
    t += min(b, n // kb)

print(r, t)

aa=int(input())
bb=int(input())
k1=int(input())
k2=int(input())
n=int(input())
if k1>=k2:
    a=(aa,k1)
    b=(bb,k2)
else:
    a=(bb,k2)
    b=(aa,k1)
a,k1=a[0],a[1]
b,k2=b[0],b[1]
##minimum
if (k1-1)*a + (k2-1)*b>=n:
    mini=0
else:
    mini=min(a+b,n-(k1-1)*a -(k2-1)*b)
###maximum
maxi=min(n // k2,b)
n=n- maxi*k2
maxi += min(a,n//k1)
print(mini,maxi)

import sys
input = sys.stdin.readline

a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())

if k1 <= k2 :
    if k1 == k2:
        if a1 < a2:
            a1, a2 = a2, a1
    maxx = min(n // k1, a1)
    n2 = n - (maxx * k1)
    maxx += min(n2 // k2, a2)
else:
    maxx = min(n // k2, a2)
    n2 = n - (maxx * k2)
    maxx += min(n2 // k1, a1)

minn = max(n - (k1 - 1) * a1 - (k2 - 1) * a2, 0)
print(minn, maxx)


a1, a2, k1, k2, n = int(input()), int(input()), int(input()), int(input()), int(input())
max1 = 0
if k1 > k2:
    a1, a2, k1, k2 = a2, a1, k2, k1
if a1*k1 >= n:
    max1 = n//k1
else:
    max1 = a1+(n-a1*k1)//k2
print(max(0, n-a1*(k1-1)-a2*(k2-1)), max1)


import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
def lis():return [int(i) for i in input().split()]
def value():return int(input())


a1=value()
a2=value()
k1=value()
k2=value()
n=value()
if k1>k2:
    k1,k2=k2,k1
    a1,a2=a2,a1
tot=0
temp = n
if n>a1*k1:
    tot+=a1
    n-=a1*k1
    if n>a2*k2:
        tot+=a2
    else:
        tot+=n//k2
else:
    tot+=n//k1

ans1=tot
tot=0
n=temp
n-=(k1-1)*a1
n-=(k2-1)*a2
if n>0:
    ans2 = min(a1+a2,n)
else:
    ans2=0

print(min(ans1,ans2),max(ans2,ans1))





a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())
minn = 0
if n > (k1 - 1) * a1 + (k2 - 1) * a2:
    minn = n - ((k1 - 1) * a1 + (k2 - 1) * a2)
maxx = 0
if k1 > k2:
    k1, k2 = k2, k1
    a1, a2 = a2, a1
if k1 * a1 < n:
    maxx = a1 + min((n - (k1 * a1)) // k2, a2)
else:
    maxx = n // k1
print(minn, maxx)

''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces1215A_live
gi = lambda : list(map(int,input().split()))
a, b, x, y, n = [gi()[0] for _ in range(5)]
l = [x for _ in range(a)]
l += [y for _ in range(b)]
l.sort()
mi = 0
nn = n
cur = 0
while nn:
	if nn < l[cur]:
		break
	nn -= l[cur]
	mi += 1
	cur += 1
nn = n
nn -= (x - 1) * a + (y - 1) * b
ma = 0
for k in range(a + b):
	if nn <= 0:
		break
	nn -= 1
	ma += 1
print(ma, mi)

a1, a2, k1, k2, n = int(input()), int(input()), int(input()), int(input()), int(input())
if k1 > k2:
    k1, k2 = k2, k1
    a1, a2 = a2, a1
oleg = a1 * (k1 - 1) + a2 * (k2 - 1)
rm = max(0, n - oleg)
if n <= a1 * k1:
    rp = n // k1
else:
    rp = a1
    rp += (n - a1 * k1) // k2
print(rm, rp)


a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())


#最小人数
min_ans = 0
kyoyou = a1 * (k1 - 1) + a2 * (k2 - 1)
min_ans = min(a1+a2, max(n - kyoyou, 0))

#最大人数
li = []
for i in range(a1):
    li.append(k1)
for i in range(a2):
    li.append(k2)
li = sorted(li)
max_ans = 0
for i in range(len(li)):
    if li[i] <= n:
        max_ans += 1
        n = n-li[i]
    else:
        break
print(min_ans, max_ans)
            


a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())
if k1 < k2:
    if a1 * k1 <= n:
        maximum = a1 + (n - a1 * k1) // k2
    else:
        maximum = n // k1
else:
    if a2 * k2 <= n:
        maximum = a2 + (n - a2 * k2) // k1
    else:
        maximum = n // k2    
    
n -= a1 * (k1 - 1) + a2 * (k2 - 1)
if n <= 0:
    minimum = 0
else:
    minimum = n

    
print(minimum, maximum)

a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())

def mn(a1, a2, k1, k2, n):
    n -= (k1 - 1) * a1 + (k2 - 1) * a2
    if n <= 0:
        return 0

    return min(n, a1 + a2)

def mx(a1, a2, k1, k2, n):
    if k1 > k2:
        a1, a2 = a2, a1
        k1, k2 = k2, k1

    if k1 * a1 >= n:
        return n // k1

    n -= k1 * a1

    return a1 + min(a2, n // k2)

print(mn(a1, a2, k1, k2, n), mx(a1, a2, k1, k2, n))



a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())
if k1 > k2:
    k1, k2 = k2, k1
    a1, a2 = a2, a1
h = (k1 - 1) * a1 + (k2 - 1) * a2
print(max(0, n - h), end=' ')
ans = min(n // k1, a1)
n = max(0, n - ans * k1)
ans += n // k2
print(ans)

a1, a2, k1, k2, n = (int(input()) for i in range(5))
w1 = a1*(k1-1)
w2 = a2*(k2-1)
n1 = n-w1-w2
mi = max(0, n1)
if k1<k2:
    k1,k2 = k2,k1
    a1,a2 = a2,a1
l2 = n//k2
n2 = min(l2,a2)
n-=n2*k2
l1 = n//k1
n3 = min(l1,a1)
print(mi, n3+n2)

a1 = int(input())
a2 = int(input())
k1 = int(input())
k2 = int(input())
n = int(input())

n_min = a1 * (k1-1) + a2 * (k2 - 1)
ost = n - n_min
if ost <= 0:
    print(0, end=" ")
else:
    print(min(a1+a2, ost), end = " ")


if k1 > k2:
    k2, k1 = k1, k2
    a1, a2 = a2, a1
d = n // k1
n_1 = min(a1, d)
n -= n_1 * k1
n_2 = min(a2, n//k2)
print(n_1+n_2)