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: Wrong Answer

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), b if a == b else max(0, a - b))


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(N, A, B):
  maxNum = max(A, B)
  minNum = max(0, (A + B) - N)
  print(maxNum, minNum)

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

Submission status: Wrong Answer

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

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

if max>10:
    print(min,max-10)
else:
    print(min,0)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(N, A, B):
  maxNum = max(A, B)
  minNum = max(0, N - (A + B))
  print(maxNum, minNum)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(maxAns, minAns)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(p, q)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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())
mx = min(a,b)
if a+b > n:
  mi = a+b -n
else:
  mi = 0
print(mx,mi)

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())
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:
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())


q=min(a, b)
w=max(0,a+b-n)

print(q,w)

Submission status: Accepted

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

max_ans = min(A,B)
if N-A-B>0:
    min_ans = 0
else:
    min_ans = abs(N-A-B)
print(max_ans, min_ans)

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:
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(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:
def LI():
    return list(map(int, input().split()))


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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, A, B = mapint()
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:
n,a,b=map(int,input().split())
x=min(a,b)
if a+b<=n:
    y=0
else:
    y=a+b-n
print(x,y)

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
MAX = min(A,B)
MIN = max(A+B-N,0)
ans = [MAX,MIN]
print(*ans)

Submission status: Accepted

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

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:
# coding: utf-8
n, a, b = map(int,input().split())
print(min(a, b), max(a+b-n, 0))

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N, A, B = map(int, readline().split())

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


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:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

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

    MaxAns = min(A, B)
    MinAns = 0
    if N >= A + B:
        pass
    else:
        MinAns = -(N - A - B)

    print(MaxAns, MinAns)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

    max_num = min(a, b)
    min_num = max(0, a + b - n)

    print(max_num, min_num)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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:
def main():
    N, A, B = map(int, input().split())
    
    if A + B >= N:
        mini = (A + B) - N
    else:
        mini = 0

    maxi = min(A, B)

    print(maxi, mini)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys, math
from functools import lru_cache
import numpy as np
import heapq
from collections import defaultdict
sys.setrecursionlimit(10**9)
MOD = 10**9+7

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

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def lcm(a, b):
    return a*b//math.gcd(a, b)


def main():
    N, A, B = mi()
    print(min(A, B), max(A+B-N, 0))



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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=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())
ans1 = min(a, b)
ans2 = max(0, (a + b) - n)
print(ans1, ans2)

Submission status: Accepted

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

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())
ma = min(a,b)
mi = max(ma - (n - max(a,b)), 0)
print(ma,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:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b, c = rm()
print(min(b, c), max(0, b+c-a))

Submission status: Accepted

Solution code:
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N,A,B=map(int,pin().split())
  t=0
  if N<=A+B:
    t=abs(N-A-B)
  print(f"{min(A,B)} {t}")
  return 

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#全国統一プログラミング王決定戦予選 a
n,a,b=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=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())
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 a == 0 or b == 0:
    print(0, 0)

elif n > a+b:
    max_ab = min(a, b)
    print(max_ab, 0)

else:
    max_ab = min(a, b)
    print(max_ab, a+b-n)

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,a,b = map(float,input().split())
print(int(min(a,b)), int(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())
X = min(A, B)
Y = max(0, A+B-N)
print(X, Y)

Submission status: Accepted

Solution code:
n, a, b = 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 = map(int, input().split())
ans1 = min(a, b)
ans2 = max(0, a + b - n)
print(ans1, ans2)

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, A, B = LI()

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

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(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
import sys
import collections
import bisect
readline = sys.stdin.readline


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
max_value = min(a, b)
if a + b - n < 0:
    min_value = 0
else:
    min_value = a + b - n
print(f'{max_value} {min_value}')

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

Submission status: Accepted

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# 約数生成
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

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

Submission status: Accepted

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

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),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), max(0,A+B-N))

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())
M = min(a, b)
m = max(0, a+b-n)
print(M, m)

Submission status: Accepted

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

Submission status: Accepted

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

if(A>B):
  ans1=B
  ans2=max(0,A-(N-B))
else:
  ans1=A
  ans2=max(0,B-(N-A))
  
print(str(ans1)+" "+str(ans2))

Submission status: Accepted

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

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:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n,a,b=nii()
print(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(0,(min(A,B)-(N-max(A,B))))
print(max_,min_)

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,a,b = readInts()
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())
print(min(A,B),max(0,A+B-N))

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, deque, Counter
import math
 
# import copy
from bisect import bisect_left, bisect_right
# import heapq
 
# sys.setrecursionlimit(1000000)
 
# input aliases
input = sys.stdin.readline
 
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]
 
INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)

def main():
    n, a, b = getList()
    mx = min(a, b)
    mn = max(a + b - n, 0)
    print(mx, mn)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N, A, B = inm()


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


print(*solve())

Submission status: Accepted

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

s=min(a,b)
t=max(a,b)

if s+t<=n:
    u=0

else:
    u=s+t-n

print(str(s)+' '+str(u))

Submission status: Accepted

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

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math, cmath
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import _heapify_max, _heappop_max, _siftdown_max
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    Num = Union[int, float]
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    # def _heappush_max(h, item): h.append(item); _siftdown_max(h, 0, len(h)-1)
    
    
    n, a, b = mi()
    print(f"{min(a, b)} {max(0, a + b - n)}")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,A,B=MI()
    a=min(A,B)
    b=max((A+B)-N,0)
    print(a,b)

main()

Submission status: Accepted

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

ans_max = min(a, b)
ans_min = max(0, a + b - n)
print("{} {}".format(ans_max, 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())
if  n < a+b:
    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())
print(min(a,b), end=" ")
c = a+b-n
if 0 < c:
  print(c)
else:
  print(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:
def main():
    N, A, B = map(int, input().split())
    mx = min(A,B)
    mi = max((A + B) - N,0)
    print(mx,mi)


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

Submission status: Accepted

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

S=min(A,B)
T=0
if A+B >N:
  T=(A+B)-N

print(S,T)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

N, A, B = MAP()

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

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())
l = []

l.append(min(a,b))

if n >= a + b:
    l.append(0)
else:
    l.append(a + b - n)

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