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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  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

#####MakeDivisors######
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)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

N,A,B = IL()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def nikkei19q_a():
    N, A, B = map(int, input().split())
    ans_max = min(A, B)
    ans_min = max(0, A + B - N)
    print(*[ans_max, ans_min], sep=' ')

nikkei19q_a()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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


if __name__ == '__main__':
    resolve()

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580

def solve():
    N,X,Y = map(int, input().split())
    print(min(X,Y),max(0,X + Y - N))
    
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

both = min(a,b)
any = max(0, (a+b) - n)

print(both, any)

Submission status: Accepted

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

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

print(r_max, r_min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    N, A, B = map(int, input().split())
    max_XY = min(A, B)
    min_XY = max(A + B - N, 0)
    print("{} {}".format(max_XY, min_XY))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

if n>=(a+b):
    MAX = min(a,b)
    MIN = 0
else:
    MAX = min(a,b)
    MIN = a+b-n

print(str(MAX)+' '+str(MIN))

Submission status: Accepted

Solution code:
N,A,B = map(int, input().split())
#質問 1 に対して「はい」と回答した人の数は A 人、質問 2 に対して「はい」と回答した人の数は B人でした。
#このとき、調査の対象者のうち新聞 X, Y の両方を購読している人の数は最大で何人であり、また最小で何人であると考えられるでしょうか？
if N-A-B >= 0:
    print(min(A,B),0)
else:
    print(min(A,B),abs(N-A-B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def S(): return sys.stdin.readline()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h,w): return [[i for j in range(w)] for k in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**5+10)
input = sys.stdin.readline


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

print(min(A,B),max)

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 -*-
"""
Created on Mon Apr 27 21:00:04 2020
"""

import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

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


b = A + B - N if A + B - N >=0 else 0
ans = [str(min(A,B)),str(b)]

print(' '.join(ans))

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, a, b = map(int, read().split())
print(min(a, b), max(0, a + b - n))

Submission status: Accepted

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

# A - Subscribers
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())
maxv = min(A, B)
if A+B-N >= 0:
    minv = A+B-N
else:
    minv = 0
print(maxv, minv)

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:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# 第2回全国統一プログラミング王決定戦予選-A
if False:
    N=int(input())
    if N%2==0: print(N//2-1)
    else: print(N//2)

# 第1回同じ-A
if False:
    M,D=map(int,input().split())
    ans=0
    for m in range(1,M+1):
        for d in range(1,D+1):
            if len(str(d))==2:
                x,y=int(str(d)[0]),int(str(d)[1])
                if x>=2 and y>=2 and x*y==m:
                    ans+=1
    print(ans)

#d2019PC2 - A
if False:
    N,K=map(int,input().split())
    MAX=N-K+1
    print(MAX-1 if K!=1 else 0)

#https://atcoder.jp/contests/nikkei2019-qual/tasks/nikkei2019_qual_a
if True:
    N,A,B=map(int,input().split())
    MAX=min(A,B)
    MIN=A+B-N if A+B>=N else 0
    print(MAX,MIN)

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

maximum = min([A, B])

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

print(maximum, minimum)

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:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n,a,b=map(int,input().split())
    print(min(a,b),max(0,a+b-n))

if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
ans_max = min(b,c)
ans_min = min(b,c)-(a-max(b,c))
if ans_min < 0:
  ans_min = 0
print(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())
max_ans = min(a,b)
min_ans = max(0, (a + b) - n)
print(max_ans, min_ans)

Submission status: Accepted

Solution code:
# 全国統一プログラミング王決定戦予選/NIKKEI Programming Contest 2019: A – Subscribers
n, a, b = map(int, input().split())
print(min(a, b), a + b - n if n <= a + b else 0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from heapq import heappop,heappush
import time
import os
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
#######################################################################################################
N,A,B=map(int,input().split())
r=0
if A+B<N:
    r=0
else:
    r=A+B-N
print(min(A,B),r)

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 copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    a1 =0
    a2=0
    if a[0] > a[1]+ a[2]:
        a1 = min(a[1],a[2])
        a2 = 0
    else:
        a1 = min(a[1],a[2])
        a2= a[1]+a[2] -a[0]
    
    print(str(a1)+" "+str(a2)  )

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

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

Submission status: Accepted

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

t = min(b, c)

if b+c < a:
    s = 0
else:
    s = b + c - a
print(t, s)

Submission status: Accepted

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

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

print(str(min(A, B)) + " " + str(mini))

Submission status: Accepted

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

M = None
m = None
if A + B <= N:
    M = min(A, B)
    m = 0
else:
    M = min(A, B)
    m = A + B - N

print(M, m)

Submission status: Accepted

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

Submission status: Accepted

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

ans1 = B if A>B else A
ans2 = A+B-N if A+B-N >= 0 else 0

print("{} {}".format(ans1, ans2))

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,x,y = map(int,input().split())
max = min(x,y)
if n-(x+y) < 0:
    min = abs(n-x-y)
else:
    min = 0
print(max,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 = [int(i) for i in input().split()]
M = min(A,B)
m = max(0,A+B-N)
print(M,m)

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N, A, B = MI()
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())

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

Submission status: Accepted

Solution code:
def main():
    population, a_reader, b_reader = map(int, input().split())
    print(min(a_reader, b_reader), max(a_reader + b_reader - population, 0))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem A - Subscribers

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

# initilization
min_ans = 0
max_ans = 0

# calc process
if A<=B:
    min_ans = A
else:
    min_ans = B

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

print("%d %d"%(min_ans, max_ans))

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n,a,b = map(int, input().split())
print('{0} {1}'.format(min(a,b), 0 if a+b<=n else 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())
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())
print(*[min(a,b), max((a+b)-n, 0)])

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

Submission status: Accepted

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

Submission status: Accepted

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

n, a, b = [int(x) for x in input().split()]
ma = a if a <= b else b
mi = 0 if n >= a + b else a + b - n
print(ma, mi)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Submission status: Accepted

Solution code:
N, A, B = [int(i) for i in 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(b+c-a,0))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
print("{} {}".format(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(str(min(A, B)) + " 0")
else :
    print(str(min(A, B)) + " " + str(abs(N - (2 * N - A - B))))

Submission status: Accepted

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

Submission status: Accepted

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

m=0
s=0
if a<b:
  m=a
else:
  m=b

if a+b>n:
  s=a+b-n
  
  
print(m,s)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())
N, A, B = map(int, input().split())

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

print (str(maxN) + " " + str(minN))

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:
def main():
    N,A,B = map(int,input().split())
    print(min(A,B),end=" ")
    print(max(0,(A+B)-N))
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(min(a,b),mi)

Submission status: Accepted

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

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

print(str(maximum)+' '+str(minimum))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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 examA():
    N, A, B = LI()
    ansmin = max(0,A+B-N)
    ansmax = min(A,B)
    print(ansmax,ansmin)
    return


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examA()

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

Submission status: Accepted

Solution code:
def main():
    N, A, B = (int(i) for i in input().split())
    x = min(A, B)
    y = max(0, x - (N - max(A, B)))
    print(x, y)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,A,B=MI()
    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())
if n>(a+b):
    print("{} {}".format(min([a,b]), 0))
else:
    print("{} {}".format(min([a,b]), abs(n-(a+b))))

Submission status: Accepted

Solution code:
# 2019/11/30

n,a,b=map(int,input().split())
print(*[min(a,b),max(a+b-n,0)],sep=' ')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, a, b = list(map(int, readline().split()))
    print(min(a, b), max(a + b - n, 0))


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,A,B = (int(i) for i in 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(0,A+B-N))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random

import os
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N,A,B = inputMap()
    
    ans1 = min(A,B)
    tmp = N-A
    if tmp >= B:
        ans2 = 0
    else:
        ans2 = B-tmp
        
    print("{} {}".format(ans1, ans2))
    
    
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(0, (A + B) - N))

Submission status: Accepted

Solution code:
#coding:utf-8

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

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

Submission status: Accepted

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