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:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor

import heapq
import itertools
import operator


def get_int():
    return int(input())


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


def get_int_list():
    return [int(i) for i in input().split()]


def get_char_list():
    return list(input().strip())


def main():
    n, a, b = get_int_list()
    max_ = min(a, b)
    min_ = max(0, a + b - n)
    print("{} {}".format(max_, min_))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

max_ans = min(A, B)
min_ans = A + B - N
if min_ans < 0:
    min_ans = 0

print(max_ans, min_ans)

Submission status: Accepted

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

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

print(max_num, min_num)

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:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
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()))
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 n >= a+b:
    ansmin = 0
else:
    ansmin = a+b-n

ansmax = min(a,b)

print(int(ansmax),int(ansmin))

Submission status: Accepted

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

print(maxAns, minAns)

Submission status: Accepted

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

max_ans = min(A, B)

min_ans = max((A+B)-N, 0)

print(max_ans, min_ans)

Submission status: Accepted

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

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

print(max_discribe, min_discribe)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, a, b = map(int, 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 > n:
    n_min =a + b - n
else:
    n_min = 0

print(min(a, b), n_min)

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:
n, a, b = [int(_) for _ in input().split()]
print("{} {}".format(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())
X = min(A, B)
Y = max(A+B-N, 0)
print(X, 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:
L = raw_input()
L = L.split()
for i, val in enumerate(L):
    L[i] = int(val)
N = L[0]
A = L[1]
B = L[2]
K = A + B - N
MAX = min(A, B)
MIN = max(0, K)
print(str(MAX)+" "+str(MIN))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, a, b = [int(i) for i in input().split()]
print("{} {}".format(min(a, b), max(0, a+b-n)))

Submission status: Accepted

Solution code:
#coding : utf-8

n = list(map(int , input().split()))

if n[1] < n[2]:
  a = n[1]
else:
  a = n[2]

b = n[2] + n[1] - n[0]
if b < 0:
  b=0

print(a," ",b)

Submission status: Accepted

Solution code:
from sys import stdin

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

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

input = lambda: stdin.readline()
main()

Submission status: Accepted

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


#%%
#n, a, b = 10, 3, 5


#%%





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


#%%

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(max, min)

Submission status: Accepted

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

Submission status: Accepted

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

ab = [A, B]
max_katu = min(ab)

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


ans = [str(max_katu), str(min_katu)]
print(' '.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

maximum = min(A, B)
minimum = 0 if N >= A + B else A + B - N

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

Submission status: Accepted

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

mx = min(a, b)

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

print(mx, mn)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
# import bisect
# import math
# import numpy as np


"""Template"""


class IP:
    """
    入力を取得するクラス
    """
    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが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 SR(self, s):
        """
        昇順ソート（reverse書くのが面倒
        返り値はありません。注意して下さい。
        SR(s) と書いたらsが昇順ソートされるだけです。
        Sort Reverse
        :param s: ソートしたいリスト
        :return: None
        """
        s.sort(reverse=True)

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x//y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)


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


def main():
    # 1文字に省略
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    n, a, b = ip.IL()
    t = min(a, b)
    y = max(max(a, b) - (n - t), 0)
    print(t, y)


main()

Submission status: Accepted

Solution code:
# A
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n
def db(x): 
    global debug
    if debug: print(x)
debug = True
N,A,B = getIntList()
mx = min(A,B)
mn = max(A+B-N,0)
print(mx,mn)

Submission status: Accepted

Solution code:
#!/Users/takahiro.kida/git/atcorder/venv/bin/python

import numpy as np
import scipy

from collections import defaultdict
from pprint import pprint

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

ans1 = min(A,B)
if A+B <= N:
    ans2 = 0
else:
    ans2 = A + B - N
print("{} {}".format(ans1,ans2))

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

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

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())
c=min(a,b)
d=max(0,a+b-n)
print(str(c)+" "+str(d))

Submission status: Accepted

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

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:
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 = (int(i) for i in input().split())
print("{} {}".format(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 = list(map(int, input().split()))
print(min(a, b), abs(min(0, n - a - b)))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

max_ = min(a, b)
min_ = n - a - b
min_ = 0 if min_ > 0 else abs(min_)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N, A, B = map(int, input().split())
    y = A + B - N
    x = min(A, B)
    if 0 > y:
        y = 0
    print(x, y)


main()

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())
if a+b<=N:
    print(min(a,b),0)
elif a+b>N:
    print(min(a,b),a+b-N)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
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())

minboth = 100
maxboth = 0

def ok(x):
    if x > min(a, b):
        return False
    if a + b - x > n:
        return False
    return True

for both in range(n + 1):
    if ok(both):
        minboth = min(minboth, both)
        maxboth = max(maxboth, both)
print(maxboth,minboth)

Submission status: Accepted

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

print(MX, 
      MN)

Submission status: Accepted

Solution code:
import math
import copy




def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input().split())
def func():
    res1=min(n[1],n[2])
    if n[1]+n[2]<=n[0]:
        res2=0
    else:
        res2=res2=n[1]+n[2]-n[0]
    return str(res1)+" "+str(res2)


print(func())

Submission status: Accepted

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

    mx = min([a, b])
    if a + b > n:
        mn = (a + b) - n
    else:
        mn = 0

    print(mx, mn)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N,A,B = map(int,input().split())
ans1 = (N - A - B)
if ans1 <= 0:
    ans1 = abs(ans1)
else:
    ans1 = 0
print(min(A,B),ans1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys

def s():
    return raw_input().strip()
def n():
    return int(raw_input())
def d():
    return float(raw_input())

def ls():
    return raw_input().strip().split()
def ln():
    return map(int, raw_input().strip().split())
def ld():
    return map(float, raw_input().strip().split())

def fs():
    return [raw_input().strip() for i in xrange(input())]
def fn():
    return [int(raw_input().strip()) for i in xrange(input())]
def fd():
    return [float(raw_input().strip()) for i in xrange(input())]

N, A, B = ln()

max_val = min(A, B)
min_val = A + B - N if A + B - N > 0 else 0

print max_val, min_val

Submission status: Accepted

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

Submission status: Accepted

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

ans=(a+b)-n

c = ans if ans>=0 else 0

print(min(a,b),c)

Submission status: Accepted

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

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

print(maximum, minimum)

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))
N,a,b = inpl()

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

Submission status: Accepted

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

ansMax = min(A, B)
if A+B <= N:
    ansMin = 0
else:
    ansMin = A + B - N

print(ansMax, ansMin)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, a, b = [int(i) for i in input().split() ]
x = min(a,b)
y = max((a+b) - n, 0)
print("%d %d" %(x,y))

Submission status: Accepted

Solution code:
def solve(N, A ,B):
    return "%d %d" % (min(A, B), max(0, A+B-N))

if __name__ == "__main__":
    N, A, B = map(int, input().split(" "))
    print(solve(N, A, B))

Submission status: Accepted

Solution code:
#横にn個入力
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())
if n > a+b:
    x = 0
else:
    x = a+b - n
print(min(a, b), x)

Submission status: Accepted

Solution code:
# S = input()
# N = int(input())
# a = list(map(int, input().split()))
# X = [int(input()) for _ in range(N)]

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

ans = 0




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

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


nikkei2019_qual_a()

Submission status: Accepted

Solution code:
n,a,b = (int(i) for i in input().split())
rmax = min(a,b)
rmin = a+b-n
if rmin<0:
    rmin = 0
print(rmax,rmin)

Submission status: Accepted

Solution code:
N,A,B = [int(i) for i in input().split()]
maxXY = min(A,B)
if A+B-N > 0:
    minXY = A+B-N
else:
    minXY = 0
print(maxXY,minXY)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print(num_max, num_min)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline
    n, a,b= map(int, input().split())
    B = [min(a,b), max(a+b-n, 0)]
    print(' '.join(map(str, B)))

Submission status: Accepted

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

print(min(a,b) , res)

Submission status: Accepted

Solution code:
import numpy as np

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

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

print(maximum, minimum)

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:
def solve():
    [N, A, B] = [int(n) for n in input().split()]

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


def main():
    ans = solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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(str(ans_max)+' '+str(ans_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 = 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())

a1 = min(A, B)

a2 = max(0, A + B - N)

print(a1, a2)

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, A, B] = [long(input_raw[0]), long(input_raw[1]), long(input_raw[2])]
    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())
maxn = min(a, b)
minn = max(0, a+b-n)
print(str(maxn)+" "+str(minn))

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

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

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, i, j = map(int, input().split())
de = 0
if(n < (i+j)): de = (i+j) - n
print("{} {}".format(min(i, j), de))

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())
m1 = min(a, b)
m2 = max(a + b - n, 0)
print("{} {}".format(m1, m2))

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

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

print(ANS1,ANS2)

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

r1 = min(A,B)
r2 = min(A,B) - (N-max(A,B))
if r2 < 0 : r2 = 0

print(r1, r2)

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 = list(map(int, input().split()))

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

Submission status: Accepted

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

def main():
    """Function."""
    n, a, b = map(int, input().split())

    maxim = min(a, b)
    minim = a + b - n

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

Submission status: Accepted

Solution code:
def main():
  n, a, b = [int(i) for i in raw_input().strip().split()]
  print('%d %d' % (min(a, b), max(a + b - n, 0)))

if __name__ == '__main__':
  main()

Submission status: Accepted

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


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

ans = [str(ma), str(mi)]

print(' '.join(ans))

Submission status: Accepted

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

ans1=0
ans2=0

if A>B:
  ans1=B
else:
  ans1=A
  
if N-A-B<0:
  ans2=abs(N-A-B)
  
print(ans1,ans2)

Submission status: Accepted

Solution code:
#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    try:
        f = open('input'+ str(inId) + '.txt', 'r')
        sys.stdin = f #标准输出重定向至文件
    except Exception:
        dprint('invalid input file')
if outId>0:
    dprint('use output', outId)
    try:
        f = open('stdout'+ str(outId) + '.txt', 'w')
        sys.stdout = f #标准输出重定向至文件
    except Exception:
        dprint('invalid output file')
        
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
N,A,B = getIntList()
#print(N)
print(min(A,B),  max(A+B-N,0) )

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

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

print(x,y)

Submission status: Accepted

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

print(p, q)

Submission status: Accepted

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

aa = min(b,c)

bb = b+c - a

if bb >= 0:
	print(aa,bb)
else:
	print(aa,0)

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:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

#x = ip()                              #入力整数1つ
#n,k= (int(i) for i in input().split())      #入力整数横2つ
x,y,z = (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

#jの変数はしようできないので注意

if y+z<x: c = 0
else:c = y+z-x

print(min(y,z),c)

Submission status: Accepted

Solution code:
N, A, B = (int(i) for i in input().split())
ans = str(min(A, B)) + " " + str(max(A+B-N, 0))
print(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:
p = input().split()
n = int(p[0])
a = int(p[1])
b = int(p[2])
if n <= a+b:
    print(str(min(a,b))+" "+str(-n+a+b))
else:
    print(str(min(a,b))+" "+str(0))

Submission status: Accepted

Solution code:
n,a,b = list(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()))

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

Submission status: Accepted

Solution code:
N, A, B = [int(a) for a in input().split()]
# N, A, B = 10, 7, 5
x = min(A, B)
y = max(0, A+B-N)
print(str(x) + " " + str(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())
if a+b-n >= 0:
    ans = a+b-n
else:
    ans = 0
print(min(a,b),ans)

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:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n, a, b = LI()


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

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

print(X, Y)