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:
n,a,b=map(int,input().split())
if n>=a+b:
    if a>b:
        print(b,0)
    else:
        print(a,0)
else:
    if a>b:
        print(b,a+b-n)
    else:
        print(a,a+b-n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_line=[int(x) for x in input().split()]
[i_N,i_A,i_B]=input_line
if i_A>=i_B:
  o_max=i_B
  o_min=i_B-(i_N-i_A)
else:
  o_max=i_A
  o_min=i_A-(i_N-i_B)
if o_min<0:
  o_min=0
if o_max>i_N:
  o_max=i_N
print("{} {}".format(o_max,o_min))

Submission status: Accepted

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

if n > 100 or a > n or b > n:
    raise ValueError

ret_max = min(a, b)

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

print(ret_max, ret_min)

Submission status: Accepted

Solution code:
def main():
    N, A, B = map(int, input().split())
    if N == A and N == B:
        # 全員が両方読んでいる場合
        print(N, N)
        return

    max_result = max([A, B])
    min_result = min([A, B])
    if A + B > N:
        # AとBの合計がNより大きい場合、最大は小さい方の数、最小はmin - (N - max)
        print(min_result, min_result - (N - max_result))
    elif A + B <= N:
        # AとBの合計がNより小さい場合、最大は小さい方の数、最小は0
        print(min_result, 0)



main()

Submission status: Accepted

Solution code:
r = input().split()
n = int(r[0])
nin = []
nin.append(int(r[1]))
nin.append(int(r[2]))

nmax = min(nin)
nmin = n - min(n, (n - nin[0]) + (n - nin[1]))
print(str(nmax) + " " + str(nmin))

Submission status: Accepted

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

Submission status: Accepted

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

#max

if A >B :
	print B,
else :
	print A,

#min

if N-A-B < 0:
	print abs(N-A-B),
else :
	print 0,

Submission status: Accepted

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

# template input
def IT():  # 整数1個
    return int(input())

def IL():  # 整数複数
    return [int(_) for _ in input().split()]

def IS():  # 文字列複数
    return [_ for _ in input().split()]

def ILS(n):  # 整数1つ　縦にズラーってなってるやつ
    return [int(input()) for _ in range(n)]

def SLS(n):  # 文字列　縦にズラーってなってるやつ
    return [input() for _ in range(n)]

def ILSS(n):  # 整数複数　縦にズラーってなってるやつ
    return [[int(_) for _ in input().split()] for j in range(n)]

# template technique
def bit_full_search(ss):
    n = len(ss)
    for i in range(1 << n):
        s = ""
        for j in range(n + 1):
            if ((1 & i >> j) == 1):
                s += ss[j]
        print(s)

def bit_full_search2(A):
    # https://blog.rossywhite.com/2018/08/06/bit-search/
    value = []
    for i in range(1 << len(A)):
        output = []

        for j in range(len(A)):
            if ((i >> j) & 1) == 1:
                # output.append(A[j])
                output.append(A[j])
        value.append([format(i, 'b').zfill(16), sum(output)])

    value.sort(key=lambda x: x[1])
    bin = [value[k][0] for k in range(len(value))]
    val = [value[k][1] for k in range(len(value))]
    return bin, val

def matching_bisect(list1_val, list2_val, n):
    # 2分探索
    j = 0
    for i in range(len(list1_val)):
        j = bisect.bisect_left(list2_val, n - list1_val[i])
        if j < len(list2_val):
            if list1_val[i] + list2_val[j] == n:
                # ans = list2_bin[j] + list1_bin[i]
                break
    return j

"""ここからメインコード"""

def main():
    n, a, b = IL()
    aa  =min(a, b)
    bb = max(0, a+b-n)
    print(aa, bb)
main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 27 20:42:18 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
    
all(nstr.count(c) for c in '753')
"""

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

result = []

result.append(min(A, B))
if (A+B) < N:
    result.append(0)
else:
    result.append(A+B - N)
print(result[0],result[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
s=min(a,b)
l=0
if n<a+b:
  l=abs(n-abs(b+a))
print("{} {}".format(s,l))

Submission status: Accepted

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

if A+B <= N:
    print(min(A,B),0)
else:
    if A+B < 2*N:
        print(min(A,B),A+B-N)
    else:
        print(N,N)

Submission status: Accepted

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

print(commonMax, commonMin)

Submission status: Accepted

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

saidai = min(a,b)

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

print(saidai," ",saisyo)

Submission status: Accepted

Solution code:
n_k = list(map(int, input().split()))
n,a,b = n_k[0],n_k[1],n_k[2]
max,min = 0,0
if n > a+b:
    min=0
    if a<b:
        max=a
    else:
        max=b
else:
    min=a+b-n
    if a<b:
        max=a
    else:
        max=b
print(str(max)+' '+str(min))

Submission status: Accepted

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

minN = 0
maxN = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

if A > B:
  A, B = B, A

upper = A
lower = max(A - (N - B), 0)

print(upper, lower)

Submission status: Accepted

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

print(min(a, b), '', end='')

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

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())
ans_max = min([a, b])
if a+b <= n:
    ans_min = 0
else:
    ans_min = a+b-n
print(ans_max, ans_min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def read():
    N, A, B = map(int, input().strip().split())
    return N, A, B


def solve(N, A, B):
    intersect_max = min(A, B)
    intersect_min = max(0, A + B - N)
    return intersect_max, intersect_min


if __name__ == '__main__':
    inputs = read()
    print("%d %d" % solve(*inputs))

Submission status: Accepted

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

N, X, Y = map(int, input().split())
max = Y
min = X
if X < Y:
    max = X
    min = Y

minn = min - (N - max)
if minn < 0:
    minn = 0

print("{} {}".format(max, minn))

Submission status: Accepted

Solution code:
inputDataStr = input()
splitData = list(map(int, inputDataStr.split()))
maxData = 0
minData = 0
allNinzuu = splitData[0]

if(splitData[1] > splitData[2]):
	maxData = splitData[1]
	minData = splitData[2]
else:
	maxData = splitData[2]
	minData = splitData[1]

if(allNinzuu > (splitData[1] + splitData[2])):
	minRyouhou = 0
else:
	minRyouhou =(splitData[1] + splitData[2]) - allNinzuu

print(minData, end=" ")
print(minRyouhou)

Submission status: Accepted

Solution code:
def data_input():
    a,b,c = input().split(' ')
    return (int(a),int(b),int(c))
def answer():
    """
    >>> output('5','-->--')
    3.83333333333333
    """
    s,a,b = data_input()
    _max = min(a,b)
    _min = 0
    if a+b > s:
        _min = (a+b) - s
    return (_max,_min)

def output():
    res = answer()
    print('{0} {1}'.format(res[0],res[1]))
output()

Submission status: Accepted

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

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

#max
if A >= B:
    max=B
else:
    max = A

print(max,min)

Submission status: Accepted

Solution code:
def run(N, A, B):
    min_ = A + B - N
    if min_ < 0:
        min_ = 0
    return '{} {}'.format(min(A, B), min_)


def main():
    N, A, B = list(map(int, input().split()))
    print(run(N, A, B))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
if a[1] >= a[2]:
  b = a[2]
if a[2] >= a[1]:
  b = a[1]

c = (a[1] + a[2]) - a[0] 
if c <= 0:
  c = 0
d = str(b) + " " + str(c)
print(d)

Submission status: Accepted

Solution code:
# Subscribers
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:
N,A,B = map(int,input().split())

largest = min(A,B)

for i in range(0,largest + 1):
	if N - A - B + i >= 0:
		smallest = i
		break
		
print(largest,smallest)

Submission status: Accepted

Solution code:
import sys

def main(inp):
    N,A,B=map(int,next(inp).split())
    mini=0
    maxi=0
    
    mini=min([A,B])
    if(N>A+B):
        maxi=0
    else:
        maxi=A+B-N
    
    ans=str(mini)+" "+str(maxi)
    
    return ans
  
print(main(sys.stdin))

Submission status: Accepted

Solution code:
n, x, y = map(int, input().split())
max_ = min(x, y)
if n - x - y >= 0:
  min_ = 0
else:
  min_ = max(0, abs(n - x - y))
print(max_, min_)

Submission status: Accepted

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

Submission status: Accepted

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

if a + b <= n:
    if a >= b:
        max = b
        min = 0
    else:
        max = a
        min = 0

else:
    if a >= b:
        max = b
        min = a + b - n
    else:
        max = a
        min = a + b - n

print(max, "", min)

Submission status: Accepted

Solution code:
N,A,B=map(int, input().split())  #複数数値入力

# 最大 A,Bの小さい方
Max = min(A,B)

x = A+B-N
Min = max(x,0)

print(Max, Min)

Submission status: Accepted

Solution code:
num1 = input()
num1 = num1.split()
if(num1[1] <= num1[2]):
    print(num1[1]+" ", end="")
else:
    print(num1[2]+" ", end="")
if(int(num1[1])+int(num1[2])-int(num1[0]) <= 0):
    print("0")
else:
    print(int(num1[1])+int(num1[2])-int(num1[0]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b=(int(i) for i in input().split())
#print(n,a,b)
ans1=min(a,b)
tmp=a+b-n
if tmp<=0:
  ans2=0
else:
  ans2=tmp
print(ans1,ans2)

Submission status: Accepted

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

l = min(a,b)
u = max(a, b)
print(l, " ", max(0, l - n + u))

Submission status: Accepted

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

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

print(max_, min_)

Submission status: Accepted

Solution code:
n,n1,n2=list(map(int,input().split(" ")))
a1,a2=0,0
if n1+n2>n:
  a2=n1+n2-n
a1=min([n1,n2])
print(str(a1)+" "+str(a2))

Submission status: Accepted

Solution code:
# codinf:utf-8

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

A_B = A + B

def small(a, b):
    if a > b:
        return b
    else:
        return a

if A_B > N:
    print(small(A, B), A_B-N)
else:
    print(small(A, B), 0)

Submission status: Accepted

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

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:
# NIKKEI
N, A, B = map(int, input().split())

bigger = max(A, B)
neither = N - bigger
max_ = A+B+neither-N
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())
max = 0
min = 0

if A <= B:
  max = A
elif A > B:
  max = B

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

Submission status: Accepted

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

x_max = min(A, B)

if A + B - N <= 0:
    x_min = 0
else:
    x_min = A + B - N

print(x_max, x_min)

Submission status: Accepted

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

maxi = min(a,b)
mini = max(0, a+b-n)

print(maxi, mini)

Submission status: Accepted

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

c = 0
d = a + b -n
if (a > b):
    c = b
else:
    c = a

if (d < 0):
    d = 0
    
print(str(c) + " " + str(d))

Submission status: Accepted

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

Submission status: Accepted

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

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_n = min(A,B)
min_n = max(0,A+B-N)
print(max_n,min_n)

Submission status: Accepted

Solution code:
#A

n, a, b = map(int, input().split())
ab = n / 2
ansa = min(a, b)
ansb = max((a+b)-n, 0)
print(ansa,ansb)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()
b=a.split()
N=int(b[0])
A=int(b[1])
B=int(b[2])
if A<B:
    if A+B<N:
        print(A,0)
    else:
        print(A,B-(N-A))
elif A>=B:
    if A+B<N:
        print(B,0)
    else:
        print(B,A-(N-B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
N,A,B = map(int, stdin.readline().rstrip().split())
if A > B:
  ans=str(B)
else:
  ans=str(A)

X=A+B -N
if X <0:
  X=0

ans = ans + ' ' + str(X)

print (ans)

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:
s=input().split()
N=int(s[0])
A=int(s[1])
B=int(s[2])
X=min([A,B])
Y=N-max([A,B])
if X-Y>0:
    print(X,X-Y)
else:
    print(X,0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, a, b = map(int, raw_input().split())
if(n<(a+b)):
	minimum = (a+b)-n
else:
	minimum = 0
maximum = min(a, b)	
print (str(maximum)+" "+str(minimum))

Submission status: Accepted

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

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

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

Submission status: Accepted

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


if a+b < n:
    mini = 0
    maxi = min(a, b)
else:
    mini =  abs((a + b)) - n
    maxi = min(a, b)

print(maxi, mini)

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, b = list(map(int, input().split()))
if a >= b:
    print(b, end=" ")
else:
    print(a, end=" ")

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b = list(map(int, input().split()))
if n > a+b:
    ans = 0
else:
    ans = a+b-n
print(min(a,b), 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())

if A > B:
    max = B
else:
    max = A

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

print(max, min)

Submission status: Accepted

Solution code:
l_ = input().split()
l = [int(s) for s in l_]

if l[1] <= l[2]:
    max_ = l[1]
else:
    max_ = l[2]

if l[1] + l[2] >= l[0]:
    min_ = l[1] + l[2] - l[0]
else:
    min_ = 0

print("{} {}".format(max_, min_))

Submission status: Accepted

Solution code:
N,A,B = map(int, input().split())
MAX_num=min(A,B)
MIN_num=N-A-B
if MIN_num>=0:
    MIN_num=0
else:
    MIN_num=-1*MIN_num
## 出力
print("{} {}".format(MAX_num,MIN_num))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n,a,b = map(int, input().split())

maximum = min(a,b)
minimum = 0

if n <= (a+b):
  minimum = (a+b)-n

print("{} {}".format(maximum, minimum))

Submission status: Accepted

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

'''
n = int(input())

a = int(input())
b = int(input())
'''


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

Submission status: Accepted

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

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 = list(map(int, input().split()))
min_v = 0
max_v = 0
ab = A + B
if N > ab:
    max_v = min(A, B)
else:
    min_v = ab - N
    max_v = min(A, B)

print('{} {}'.format(max_v, min_v))

Submission status: Accepted

Solution code:
[N,A,B] = list(map(int,input().split()))	
if N > A+B:
    maxNum = min(A,B)
    minNum = 0
else:
    maxNum = min(A,B)
    minNum = A + B - N
print(maxNum, minNum)

Submission status: Accepted

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

min_num = min(A,B)

if A+B <= N:
  max_num = 0
else:
  max_num = abs(N-(A+B))
  
print(min_num,max_num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

maxNum = A
if B < maxNum:
    maxNum = B

# 新聞XとYの重複がなかった場合
oneRead = A+B
if N < oneRead:
    minNum = oneRead - N
else:
    minNum = 0


print(maxNum, minNum)

Submission status: Accepted

Solution code:
num = list(map(int,input().split()))
if num[1] > num[2]:
  a = num[2]
else:
  a = num[1]
b = num[1] + num[2] - num[0]
if b < 0:
  b = 0
print(str(a) + " " + str(b))

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:
N, A, B = map(int,input().split())
M = min(A, B)
if A + B < N:
    m = 0
else:
    m = A + B - N
print(M, m)

Submission status: Accepted

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

large = A if A > B else B
small = B if A > B else A

both_max = small
both_min = small + large - N
if both_min < 0:
    both_min = 0

print('{} {}'.format(both_max, both_min))

Submission status: Accepted

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

Submission status: Accepted

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

maximum = min(a,b)
minimum = max(0, a+b-n)

print(maximum, minimum)

Submission status: Accepted

Solution code:
li = [int(i) for i in input().split()]
n = li[0]
a = li[1]
b = li[2]
res1 = min(a,b)
if a+b-n<0:
    res2 =0
else:
    res2=a+b-n
print(res1, res2)

Submission status: Accepted

Solution code:
N,A,B=[int(x) for x in input().split()]
ansmax = min(A,B)
ansmin = min(A-min(A,N-B),B-min(B,N-A))
print(str(ansmax)+' '+str(ansmin))

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:
# coding: utf-8
N, a, b = list(map(int, input().split()))
if a >= b:
    m = b
else:
    m = a
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 (str(min(A,B))+" ",end="")
if A+B>N:
    print (A+B-N)
else:
    print("0")

Submission status: Accepted

Solution code:
# 2019/01/27
# NIKKEI Programming Contest 2019 - A

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

# Choose Max
if a <= b:
    max = a
else:
    max = b

# Choose Min
if a + b <= n:
    min = 0
else:
    min = (a + b) - n

# Output
print(max, min)

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 = list(map(int, input().split()))
n_max = min(A, B)
n_min = max(0, A + B - N)
print(n_max, n_min)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(min(A, B), ans)

Submission status: Accepted

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

n_max = min(a, b)
if n - a - b < 0:
    n_min = abs(b - n + a)
else:
    n_min = 0

print(n_max, n_min)

Submission status: Accepted

Solution code:
s = input().split()

N = int(s[0])
a = int(s[1])
b = int(s[2])

ans1 = 0
ans2 = 0

ans1 = min(a, b)
if N <= a+b:
    ans2 = abs(a+b-N)

print(ans1, ans2)

Submission status: Accepted

Solution code:
ns = list(map(int, input().split()))

N = ns[0]
A = ns[1]
B = ns[2]

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

maxXY = min(A,B)

print(maxXY,minXY)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# 全国統一プログラミング王決定戦予選：A - Subscribers


def main():
    N, A, B = [int(i) for i in raw_input().strip().split(' ')]

    x = min(A, B)
    y = A + B - N
    if y < 0:
        y = 0
    print x, y


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,A,B=[int(x) for x in raw_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:
    if a+b > n:
        print(b,a+b-n)
    else:
        print(b,0)
elif b >= a:
    if a+b > n:
        print(a,a+b-n)
    else:
        print(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:
a=[]#入力画面の二文字を別々の文字に格納
a=input().split(" ")
N=int(a[0])
A=int(a[1])
B=int(a[2])
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 = list(map(int, input().split()))
m1 = min(A,B)
m2 = max(A + B - N,0)
print(m1,m2)

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(a + b - n, 0)
)

Submission status: Accepted

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

if N < A+B:
  ans = A + B - N
else:
  ans = 0

print(min([A,B]),ans)

Submission status: Accepted

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

Submission status: Accepted

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

if a > b:
    a, b = b, a

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

print(max, min)

Submission status: Accepted

Solution code:
import bisect
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    N, a, b = il()
    return "{} {}".format(min(a, b), max(0, a - (N - b)))


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

tmp=input()
n = int(tmp.split(" ")[0])
a = int(tmp.split(" ")[1])
b = int(tmp.split(" ")[2])

x=int(0)
y=int(0)

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

print(x,y)

Submission status: Accepted

Solution code:
nab=list(map(int,input().split()))
n=nab[0]
a=nab[1]
b=nab[2]
c=min(a,b)
if n > a+b:
    d = 0
else:
    d = a+b-n
print("%d %d" %(c,d))

Submission status: Accepted

Solution code:
n,a,b = (int(i) for i in 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 max(A, B) - (N - min(A, B)))

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:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A, B):
    return '%d %d'%(min(A, B), max((A+B)-N, 0) )


def main():
    # N = read_int()
    N, A, B = read_int_n()
    print(slv(N, A, B))


if __name__ == '__main__':
    main()

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:
a = list(map(int, input().split()))
N = a[0]
A = a[1]
B = a[2]

ans = [0, 0]
ans[0] = min(a)

if N <= A + B:
  ans[1] = A + B - N

print(' '.join([str(i) for i in ans]))

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:
from string import ascii_lowercase
def inpl(): return list(map(int, input().split()))
N, A, B = inpl()
if A + B <= N:
    C = 0
else:
    abs(A - B)

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

Submission status: Accepted

Solution code:

def _main():
    N, A, B = map(int, input().split())
    max_count = min(A, B)
    min_count = max((A + B) - N, 0)
    print('{} {}'.format(max_count, min_count))


if __name__ == '__main__':
    _main()

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
q=min(b,c)
w=b+c-a
print("{} {}".format(q,max(0,w)))

Submission status: Accepted

Solution code:
n, x, y = [int(i) for i in input().split()]
tmp = x+y-n
if tmp <= 0:
    tmp = 0
print(min(x, y), tmp)

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
if A >= B:
    ans = B
else:
    ans = A

ansmin = A+B-N
if ansmin < 0:
    ansmin = 0

print(str(ans)+ " " + str(ansmin))

Submission status: Accepted

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