Problem:


Score : 100 points

Problem Statement

We conducted a survey on newspaper subscriptions.
More specifically, we asked each of the N respondents the following two questions:

Question 1: Are you subscribing to Newspaper X?

Question 2: Are you subscribing to Newspaper Y?

As the result, A respondents answered "yes" to Question 1, and B respondents answered "yes" to Question 2.

What are the maximum possible number and the minimum possible number of respondents subscribing to both newspapers X and Y?

Write a program to answer this question.

Constraints

1 \leq N \leq 100

0 \leq A \leq N

0 \leq B \leq N

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N A B

Output

Print the maximum possible number and the minimum possible number of respondents subscribing to both newspapers, in this order, with a space in between.

Sample Input 1

10 3 5

Sample Output 1

3 0

In this sample, out of the 10 respondents, 3 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.

Here, the number of respondents subscribing to both newspapers is at most 3 and at least 0.

Sample Input 2

10 7 5

Sample Output 2

5 2

In this sample, out of the 10 respondents, 7 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.

Here, the number of respondents subscribing to both newspapers is at most 5 and at least 2.

Sample Input 3

100 100 100

Sample Output 3

100 100



Sample input:
10 3 5


Sample output:
3 0

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

#input
N, A, B = map(int, input().split())

#output
M = min(A, B)
m = 0
if A+B > N:
    m = A+B-N
else:
    m = 0

print(M, m, sep = " ")

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
mn = None
mx = None

mx = min(a, b)

if n >= a+b:
    mn = 0
else:
    mn = a+b-n

print(mx, mn)

Submission status: Accepted

Solution code:
from sys import stdin
import fractions

n,a,b = [int(x) for x in stdin.readline().rstrip().split()]

print(min(a,b),max(0,a+b-n))

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
print(a if a<b else b,end=" ")
print(a+b-n if a+b-n>0 else 0)

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())

ans = []

ans.append(min(a,b))
ans.append(max(0,a+b-n))

print(*ans)

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split(' '))

x = min(a, b)
if (a + b) > n:
    y = (a + b) - n
else:
    y = 0 

print(x, y)

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
maxv = min(A, B)
minv =  max(0, maxv - (N-max(A, B)))
print(maxv, minv)

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split())
print(min(A,B),max(0,min(A,B) -(N-max(A,B))))

Submission status: Accepted

Solution code:
N, A, B = map(int,input().split())
M = min(A, B)
m = max(B - (N-A), 0)
print(M, m)

Submission status: Accepted

Solution code:
n,a,b = [int(i) for i in input().split()]

print(min(a,b), a+b-n if a+b-n > 0 else 0)

Submission status: Accepted

Solution code:
#a
n,a,b=map(int,input().split())
print( min(a,b),max(a+b-n,0))

Submission status: Accepted

Solution code:
inpl = lambda: list(map(int,input().split()))
N, A, B = inpl()
print(min(A,B), max(0, A+B-N))

Submission status: Accepted

Solution code:
def main():
    n, a, b = map(int, input().split())

    mx = min(a, b)
    mn = max(0, a + b - n)

    print(mx, mn)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split(' '))

max = 0
min = 0

if a > b:
  max = b
  min = b - (n - a)
else:
  max = a
  min = a - (n - b)

if min < 0:
  min = 0

# print(n, a, b)
print('{} {}'.format(max, min))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())

x = min(a,b)
y = max(a+b-n, 0)

print(x, y)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!


n,a,b = map(int,input().split())

print(min(a,b))
print(max(a+b-n,0))

Submission status: Accepted

Solution code:
N, A, B = list(map(int,input().split()))

up = min(A,B)

if A+B >= N:
  down = A+B-N
else:
  down = 0
  
print(up,down)

Submission status: Accepted

Solution code:
a,b,c = [int(i) for i in input().split()]

print(min(b,c),b+c-a if b + c >= a else 0)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
x=a+b-n
if x>=0:
  x+=0
else:
  x=0
  
print(min(a,b),x)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
ans_max=min(a,b)
ans_min=max(a+b-n,0)
print(ans_max,ans_min)

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())

print(min(A, B),max(A+B-N,0))

Submission status: Accepted

Solution code:
n, a, b = map(int,input().split())
h = min(a, b)
c = a+b-n
if c < 0:
    l = 0
else:
    l = c
print(h, l)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
int1 = lambda x: int(x) - 1

def main():
    n,a,b=map(int, input().split())
    mx=min(a,b)
    mn=max(a+b-n,0)
    print(mx,mn)

main()

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
print(min(A,B), end = " ")
print(max(0, A+B-N))

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
x=0
if a+b<n:
    x=0
else:
    x=a+b-n
print(min(a,b),x)

Submission status: Accepted

Solution code:
N,A,B = map(int, input().split())

ans1 = min(A,B)
ans2 = max(A+B-N, 0)
print(ans1, ans2)

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
ma = min(A,B)
mi = A+B-N
if mi<=0:
    mi = 0
print(ma,mi)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, A: int, B: int):
    print(min(A,B),max(0,A+B-N))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(N, A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())

ma = min(a, b)
if a + b - n < 0:
    mi = 0
else:
    mi = a + b - n

print(ma, mi)

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n, a, b = list(map(int, input().rstrip('\n').split()))
    print(min(a, b), max(0, a + b - n))


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
#%%
n, a, b = map(int, input().split())
ans1 = min(a, b)
ans2 = max(a + b - n, 0)
ans = ' '.join([str(ans1), str(ans2)]) 
print(ans)

Submission status: Accepted

Solution code:
N, A, B = tuple(map(int, input().split()))
print(min(A, B), max(0, (A + B) - N))

Submission status: Accepted

Solution code:
from sys import stdin
N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
MAX = min(A,B)
MIN = max(A+B-N,0)
print(MAX,MIN)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
if a+b-n>0:
  ans=a+b-n
else:
  ans=0
print(min(a,b),ans,sep=' ')

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
min_num = max(0, a + b - n)
max_num = min(a, b)
print(*[max_num, min_num])

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())

ans=[0,0]

ans[0]=min(a,b)
ans[1]=max(0,a+b-n)
print(*ans)

Submission status: Accepted

Solution code:
N, A, B = list(map(int, input().split()))

print(min(A, B), max(0, A + B - N))

Submission status: Accepted

Solution code:
n,a,b = map(int, input().split())
ma = min(a,b)
if a+b <=n:
  mi = 0
elif a+b >n:
  mi = abs(n-(a+b))
print(ma,mi)

Submission status: Accepted

Solution code:
N,A,B=list(map(int,input().split()))
ans1=min(A,B);ans2=max(0,A+B-N)
print(ans1,ans2)

Submission status: Accepted

Solution code:
n, a, b = list(map(int, input().split()))
t1 = min(a, b)
t2 = max(0, b-(n-a))
print(t1, t2)

Submission status: Accepted

Solution code:
def resolve():
    n, a, b = map(int, input().split())
    if n >= a + b:
        mn = 0
    else:
        mn = a + b - n
    print(min(a, b), mn)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())

maxA = min(A, B)
minA = 0
if N - max(A, B) < maxA:
    minA = maxA - (N- max(A, B))
print(maxA, minA)

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
M=min(a,b)
m=a+b-n
if(m<0):
    m=0
print(M,m)

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())

print(min(a,b),max(0,a+b-n))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
rmax = min(A, B)
rmin = max(0, A+B-N)
print(rmax, rmin)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
and_=min(a,b)
or_=max(0, a+b-n)
print(and_, or_)

Submission status: Accepted

Solution code:
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque


def main():
    num, a, b = map(int, input().split())
    print(min(a, b), max(0, a + b - num))





if __name__ == '__main__':
    main()
    # test()

Submission status: Accepted

Solution code:
def main():

    N, A, B = map(int, input().split())
    max_v = min(A, B)
    min_v = max(0, A+B-N)

    print(" ".join(map(str, [max_v, min_v])))

if __name__ == '__main__':
    # print(main())
    main()

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
X = 0
if N<A+B:
  X = A+B-N
else:
  X = 0
print(min(A,B),X)

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n, a, b = list(map(int, input().rstrip('\n').split()))
    print(min(a, b), max((a + b) - n, 0))


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
print(min(n[1], n[2]), max(0, n[1] + n[2] - n[0]))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split(' '))
if a+b <= n:
    min_p = 0
else:
    min_p = abs(n-a-b)
max_p = min([a,b])
print(max_p, min_p)

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
print(min(a,b),a+b-n if a+b>=n else 0)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N, A, B = map(int, input().split())

# print(N)
# print(A)
# print(B)

if A < B:
    print(A)
else:
    print(B)
    
# print((A + B) - N)

if ((A + B) - N) >= 0:
    print((A + B) - N)
else:
    print(0)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
print(min(a,b))
if a+b<n:print(0)
else:print(a+b-n)

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
print(min(a,b), max(a+b-n,0))

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
if a+b > n:
    print(min(a,b), a+b-n)
else:
    print(min(a,b), 0)

Submission status: Accepted

Solution code:
def solve(n, a, b):
    return " ".join(map(str, [min(a,b), max(0,a+b-n)]))

n, a, b = map(int, input().split())
print(solve(n, a, b))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
print(min(A,B), max(A+B-N,0))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
x = min(a,b)
if a+b > n:
    y = a+b-n
else:
    y=0
print(x,y)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
print(a if a<b else b, 0 if a+b<n else a+b-n)

Submission status: Accepted

Solution code:

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N,A,B = inpl()

MAX = min(A,B)
MIN = max(0,A+B-N)
print(MAX,MIN)

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
print("%d %d" % (min(A, B), max((A+B)-N, 0)))

Submission status: Accepted

Solution code:

n, a, b = [ int(v) for v in input().split() ]
print(min(a,b), max(0,a+b-n))

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
print(min(a,b),end=" ")
print(max(a+b-n,0))

Submission status: Accepted

Solution code:
n, a, b = map(int,input().split())
print(min(a, b), end=' ')
print(max(a+b-n,0))

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())

print(min(a,b), end=' ')
print(a+b-n if a+b-n>0 else 0)

Submission status: Accepted

Solution code:
N, A, B= map(int, input().split())
print(min(A, B), max(0, A + B - N))

Submission status: Accepted

Solution code:
N, A, B = [int(_) for _ in input().split()]

print(min(A, B), max(A + B - N, 0))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())

print (min(A, B), max(A + B - N, 0))

Submission status: Accepted

Solution code:
import numpy as np


def main():
    n, a, b = map(int, input().split())
    ans_max = min(a, b)
    ans_min = max(a + b - n, 0)
    print(ans_max, ans_min)

    



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,a,b = map(int, input().split())

d = min(a,b)
m = a+b-n

if m < 0:
    m = 0

print("{} {}".format(d,m))

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())

mx = min(A,B)
mi = max(A+B-N,0)

print(str(mx) + " " + str(mi))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
print(min(A, B), max(0, A + B - N))

Submission status: Accepted

Solution code:
print(*["{0} {1}".format(min(x[1],x[2]),x[1]+x[2]-x[0] if x[1]+x[2]-x[0]>0 else 0) for x in [[int(x) for x in input().split()]]])

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
ans1 = min(A, B)
ans2 = max(A + B - N, 0)
print("{} {}".format(ans1, ans2))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())

d = N - (A + B)
print(min(A, B), -d if d < 0 else 0)

Submission status: Accepted

Solution code:
# nikkei2019-qualA - Subscribers
def main():
    n, a, b = list(map(int, input().rstrip().split()))
    print(min(a, b), max(0, (a + b) - n))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())

print(min(a, b), max(0, a + b - n))

Submission status: Accepted

Solution code:
N, X, Y = map(int, input().split())
ans =  X+Y-N
if ans < 0:
    ans = 0
print(min(X,Y), ans)

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
print(min(a, b), max(a+b-n, 0))

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split())
print(min(A,B), max(0,A+B-N))

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
print(str(min(a,b))+' '+str(max(a+b-n,0)))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
max_sub = min(a, b)
min_sub = max_sub - (n-max(a, b))

print(max_sub, min_sub if min_sub > 0 else 0)

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
print("{0} {1}".format(min(A, B), max(A + B - N, 0)))

Submission status: Accepted

Solution code:
n, a, b = [int(i) for i in input().split()]
if n-(a+b)>0:
    print(min(a,b), 0)
else:
    print(min(a,b), abs(n-(a+b)))

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
M=min(a,b)
m=max(0,a+b-n)
print(M,m)

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N, A, B = list(map(int, sys.stdin.readline().split()))
print(min(A, B), max(0, A+B-N))

Submission status: Accepted

Solution code:
a, b, c = [int(item) for item in input().split()]
print(min(b, c), max((b+c) - a, 0))

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
a = min(A,B)
b = max(0,A+B-N)
print(a,b)

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
print(str(min(A,B)),max(0,A+B-N))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
max_ = min(a, b)
min_ = max(a + b - n, 0)
print(max_, min_)

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
saidai = min(a,b)
saisyo = max(0,a+b-n)
print(saidai,saisyo)

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split(" "))
print(min(A, B), max(0, A + B - N))

Submission status: Accepted

Solution code:
# PROXY

list = [int(i) for i in input().split()]
print(min(list),(list[1] + list[2]) - list[0] if (list[1] + list[2]) - list[0] > 0 else 0)

Submission status: Accepted

Solution code:
###template###
import sys
input = sys.stdin.readline
def mi(): return map(int, input().split())
###template###

N, A, B = mi()
ans = [0,0]
ans[0] = min(A,B)
ans[1] = max(A+B-N,0)

print(ans[0], ans[1])

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
print(min(A, B), max(A + B - N, 0))

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
print(min(a,b),a+b-n) if a+b>n else print(min(a,b),0)

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
if n >= a+b:
    print(min(a, b), 0)
else:
    print(min(a, b),(a+b-n))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())

print(min(a, b),0 if (a + b) <= n else abs(b - (n - a)))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
if N>=A+B:
	print(str(min(A, B)) + ' 0')
else:
	print(str(min(A, B)) + ' ' + str(A+B-N))

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
print(min(a,b),max(0,a + b - n))

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
ans1 = min(a,b)
ans2 = max(a+b-n,0)
print(ans1,ans2)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())

max=min(a,b)

if n>a+b:
  min=0
  
else:
  
  min=a+b-n
  
  
print(int(max),int(min))

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
print(min(b,c),max(0,b+c-a))

Submission status: Accepted

Solution code:
n,x,y=map(int,input().split())
print(min(x,y),max(0,x+y-n))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())

max_ = min(a, b)

if max(n, a+b) == a+b:
    min_ = a + b - n
else:
    min_ = 0

print(max_, min_)

Submission status: Accepted

Solution code:
if __name__=="__main__":
    n, A, B = input().split(' ')
    n = int(n)
    A = int(A)
    B = int(B)
    print(min(A, B),  max(B - (n - A), 0))

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
if a+b-n>=0:
  print(min(a,b),a+b-n)
else:
  print(min(a,b),0)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
maxi=min(a,b)
mini=a+b-n
if a+b-n<=0:
    mini=0
print(maxi,mini)

Submission status: Accepted

Solution code:
n, a, b = map(int,input().split())
nmax = min(a, b)
nmin = max(a + b - n, 0)
print(nmax, nmin, sep = " ")

Submission status: Accepted

Solution code:
# coding: utf-8

N, A, B = map(int, input().split())

largest = min(A, B)
minimum = max(0, A + B - N)

print(largest, minimum)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, A: int, B: int):
    print(min(A, B), max(0, A + B - N))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(N, A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,x,y=map(int,input().split())
if (x+y)>n:
  mn=(x+y)-n
else:
  mn=0
mx=min(x,y)
print('{} {}'.format(mx,mn))

Submission status: Accepted

Solution code:
A = list(map(int,input().split()))
if A[1] + A[2] < A[0]:
  b = 0
else:
  b = A[1] + A[2] - A[0]
x = [A[1], A[2]]
print(min(x) ,b)

Submission status: Accepted

Solution code:
N, A, B = map( int, input().split() )


print( min(A, B), max(A+B-N, 0) )

Submission status: Accepted

Solution code:
N, A, B = list(map(int, input().split()))
print(min(A, B), max(- N + A + B, 0))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())

if a+b < n:
    max = min(a, b)
    min = 0
else:
    max = min(a, b)
    min = (a+b)-n
print(max, min)

Submission status: Accepted

Solution code:
n,a,b = (int(i) for i in input().split())

print("{} {}".format(min(a,b), max(a+b-n,0) ))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
ans_min = 0 if a+b-n <0 else a+b-n
print(min(a, b), ans_min)

Submission status: Accepted

Solution code:
n,a,b = map(int, input().split())
print(min(a, b), max(0, a + b - n))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
print(min(A,B), max(0, A+B-N))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
ResMax = min(A, B)
ResMin = max(0, A+B-N)
print(ResMax, ResMin)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split());print(min(b,c),max(0,b+c-a))

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split(' '))
print(str(min(A,B))+' '+str(max(0,(A+B-N))))

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
_max = min(A,B)
_min = min(A,B) - (N - max(A,B))
if _min < 0:
    _min = 0
print(_max,_min)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
print(min(B,C),max(B+C-A,0))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
print(min(a,b), max(a+b-n, 0))

Submission status: Accepted

Solution code:
N, A, B = [ int(x) for x in input().split() ]

ans = (min(A, B), max(0, A + B - N))

print(ans[0], ans[1])

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
print(B if A > B else A, end=" ")
z = A + B - N
print(z if z > 0 else 0)

Submission status: Accepted

Solution code:
N, A, B = map(int,input().split())
max_ans = min(A,B)
tmp = A + B - N
min_ans = 0 if tmp<=0 else tmp
print(max_ans, min_ans)

Submission status: Accepted

Solution code:
N, X, Y = map(int, input().split())

res1 = min(X, Y)

if X + Y <= N:
  res2 = 0
  
else:
  res2 =  X + Y - N
  
print(res1, res2)

Submission status: Accepted

Solution code:
"""
A - Subscribers
"""


def solve():
    N, A, B = map(int, input().split())
    max_both = B if A > B else A
    min_both = (A + B) - N if (A + B) > N else 0
    print(max_both, min_both)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
Moji=str(input())
ListNAB=Moji.split() #N,A,Bの順にリストに格納
N=int(ListNAB[0])
A=int(ListNAB[1])
B=int(ListNAB[2])
if A>=B:
  nmax=B

elif A<B:
  nmax=A

if N>A+B:
  nmin=0

if N<=(A+B):
    nmin=A+B-N

print(str(nmax)+" "+str(nmin))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())

ma = str(min(A,B))
if A+B-N > 0:
    mi = str(A + B - N)
else:
    mi = str(0)
print(ma+' '+mi)

Submission status: Accepted

Solution code:
i = [int(each) for each in input().split()]
print(min(i[1], i[2]), max(i[1] + i[2] - i[0], 0))

Submission status: Accepted

Solution code:
n,a,b = list(map(int,input().split()))

if(a+b <= n):
    print(str(min(a,b)) + " 0")
else:
    print(str(min(a,b)) + " " + str(abs(a+b-n)))

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())

print(min(A,B), max((A+B)-N, 0))

Submission status: Accepted

Solution code:
#A
N,A,B=map(int,input().split())
print(min(A,B),max(A+B-N,0))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
li = [a,b]
maxi = min (li)
m = 0
if a + b <= n:
    m = 0
    
if a + b > n:
    m = a + b - n

print(maxi,m)

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def main():
    N, A, B = map(int, input().split())
    print(min(A, B), max(0, (A + B) - N))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n, a, b = map(int, input().strip().split())
print(min(a, b), (max(a+b-n, 0)))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N, A, B = list(map(int, input().split(" ")))
print("{} {}".format(min(A,B), max(A+B-N, 0)))

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
print(min(a,b),(0 if n>=a+b else (a+b)-n))

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
if N < A+B:
  print(min(A,B),A+B-N)
else:
  print(min(A,B),0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18

N, A, B = map(int, raw_input().split())

print min(A, B), max(0, A + B - N)

Submission status: Accepted

Solution code:
N, A, B = [int(i) for i in input().split()]

max = min([A, B])


num = A + B - N
if (num <= 0):
    minor = 0

else:
    minor = num

print(max, minor)

Submission status: Accepted

Solution code:
import numpy as np
x = np.array(input().split(' '), int)
print(x[1:].min(),' ', 0 if x[0] >= x[1:].sum() else x[1:].sum() - x[0])

Submission status: Accepted

Solution code:
N, A, B = map(int,input().split())
li = [A, B]
if sum(li)<=N:
  a = 0
else:
  a = sum(li)-N
print(min(li),a)

Submission status: Accepted

Solution code:
N, A, B = [int(x) for x in input().split()]
ma = min(A,B)
mi = max(0,(A+B)-N)
print("{} {}".format(ma,mi))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
print('{} {}'.format(min(a, b), max(0, a+b-n)))

Submission status: Accepted

Solution code:
N,A,B = (int(x) for x in input().split())
if(A<B):
    max = A
else:
    max = B

min = A+B
if(min>N):
    min = min - N
else:
    min = 0

print(max,min)

Submission status: Accepted

Solution code:
n, a, b = list(map(int, input().split()))
maxab = min(a, b)
minab = (a+b)-n
if minab < 0:
  minab = 0
  
print(maxab, minab)

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split())
Max=min(A,B)
min=0
if (A+B)>=N:
    min=A+B-N
else:
    min=0
print(Max,min)

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
both = min(A, B)
none = 0 if A+B-N<0 else A+B-N
print(both, none)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
c=min(a,b)
d=max(0,a+b-n)
print(c,d)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, A, B = MAP()

mx = min(A, B)
mn = max(A + B - N, 0)

print(mx, mn)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
if a+b<n:
    Max=min(a,b)
    Min=0
else:
    Max=min(a,b)
    Min=max(a,b)-(n-min(a,b))

print("{0} {1}".format(Max,Min))

Submission status: Accepted

Solution code:
n, a, b = map(int, raw_input().split())
print min(a, b), max(0, a + b - n)

Submission status: Accepted

Solution code:
n, a, k = map(int, input().split())

if a >= k:
	max = k
else:
	max = a

min = a + k - n

if min < 0:
	min = 0

print(max, min)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N, A, B = map(int, input().split())
    print(min(A, B), max(A+B - N, 0))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
population_max = a
if b < a:
    population_max = b
population_min = 0
if a+b > n:
    population_min = (a+b)-n
print('{0} {1}'.format(population_max, population_min))

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
maxN,minN = 0,0

if N >= A + B:
  minN = 0
  maxN = min([A,B])
else:
  minN = A + B - N
  maxN = min([A,B])
  
print('{} {}'.format(maxN,minN))

Submission status: Accepted

Solution code:
n,a,b=map(int,raw_input().split())
print min(a,b),max(0,a+b-n)

Submission status: Accepted

Solution code:
import sys

n,a,b=map(int,sys.stdin.readline().split())

print(min(a,b), end=" ")
min = 0 if (n>=a+b) else abs(a+b-n)
print(min)

Submission status: Accepted

Solution code:
n,a,b = list(map(int, input().split()))

if a < b:
  max = a
else:
  max = b

min = (a + b) - n
if min < 0:
  min = 0
 
print(max, min)

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
max = min(a,b)
if a+b > n:
    min = a+b-n
else:
    min = 0

print('{} {}'.format(max, min))

Submission status: Accepted

Solution code:

n , a, b = map(int, input().split())
n = int(n)
a = int(a)
b = int(b)


if (a > b ) :
	mx_x = b
else:
	mx_x = a

if ((a+b - n)<0):
	mx_y = 0
else:
	mx_y = a+b-n

print(str(mx_x) + ' ' + str(mx_y))

Submission status: Accepted

Solution code:
n, a, b=map(int, input().split())
print(min(a,b),max((a+b)-n,0))

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split(" "))
if N-A-B>0:
	W=0
else:
    W=A+B-N
print(min(A,B),W)

Submission status: Accepted

Solution code:
N, A, B = [int(x) for x in input().split()]
print(min(A,B),max(0,A+B-N))

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
v_max = min(n,a,b)
v_min = max(a+b-n, 0)
print(v_max, v_min)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
print(min(a,b),(a+b-n if a+b-n>0 else 0))