Problem:


Score : 100 points

Problem Statement

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

Question 1: Are you subscribing to Newspaper X?

Question 2: Are you subscribing to Newspaper Y?

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

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

Write a program to answer this question.

Constraints

1 \leq N \leq 100

0 \leq A \leq N

0 \leq B \leq N

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N A B

Output

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

Sample Input 1

10 3 5

Sample Output 1

3 0

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

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

Sample Input 2

10 7 5

Sample Output 2

5 2

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

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

Sample Input 3

100 100 100

Sample Output 3

100 100



Sample input:
10 3 5


Sample output:
3 0

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N, A, B = li_input()

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

    print(ansmax, ansmin)


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

import math
import fractions
import heapq
import collections
import re
import array
import bisect

from collections import Counter, defaultdict


def array2d(dim1, dim2, init=None):
    return [[init for _ in range(dim2)] for _ in range(dim1)]

II = lambda: int(input())
MI = lambda: map(int, input().split())


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())

def getMN():
    a = input().split()
    b = [int(i) for i in a]
    return b[0],b[1]

def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b

n, a, b = getlist()

ma = str(min(a,b))
mi = str(max(a+b-n, 0))

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

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

print(str(ans1) + ' ' + str(ans2))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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


print(maxi, mini)

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:
n, a, b = [int(i) for i in input().split()]
print(min(a, b), max(0, a + b - n))

Submission status: Accepted

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

ans_max = min(a, b)
ans_min = max(a+b-n, 0)

print(ans_max, ans_min)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stderr, setrecursionlimit
setrecursionlimit(2147483647)
def getInt():
    return int(input())
def getInts():
    return [int(i) for i in input().split()]
def getIntLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInt())
    return res
def getIntsLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInts())
    return res
def debug(*args, **kwargs):
    print(*args, file=stderr, **kwargs)

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

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

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 = [int(elem) for elem in input().split()]

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

print(max_people, min_people)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

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 LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n,a,b = LI()

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



print(main())

Submission status: Accepted

Solution code:

def main():
    buf = input()
    buflist = buf.split()
    N = int(buflist[0])
    A = int(buflist[1])
    B = int(buflist[2])
    print(min(A,B), max(0, (A+B)-N))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n, a, b = map(int, raw_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(N,A,B),max(A+B-N,0))

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
def ma():return map(int, input().split())#a,b,c,d or n,k
n,a,b= ma()
d = max(0,a+b-n)
e = min(a,b)
print(e,d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

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:

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

ans1 = min(A,B)
ans2 = max(0, -(N-A-B))
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:
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
    #n=int(input())
    n,k,s= map(int, sys.stdin.readline().split(' '))
    print(min(k,s),max(0,k+s-n))
    #a=list(map(int,sys.stdin.readline().split(' ')))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
import math
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007

#A
n,a,b = LI()
ans = [min(a,b),max(0,a+b-n)]
print(ans[0],ans[1])
#B

#C

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

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

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:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict, Counter
from bisect import bisect

setrecursionlimit(10**7)

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

N, A, B = reads()

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

Submission status: Accepted

Solution code:
def main():
    n, a, b = (int(z) for z in input().split())
    res_max = min(a, b)
    res_min = max(0, a + b - n)
    print(res_max, res_min)


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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
# import numpy as np

s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()


N, A, B = ds_in()

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

print(a, b)

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

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

Submission status: Accepted

Solution code:
def inpl(): return [int(i) for i in input().split()]
N, A, B = inpl()
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:
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:
def read():
    return int(input())


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


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


N, A, B = readmap()

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,a,b = li()
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: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,A,B=map(int, input().split())
#最大の数
x = min(A, B)
#最小
y = 0
        
if N < A+B:
    if A > B:
        y = A - B
    else:
        y = B - A

print(x + " " + y)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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(''.join(l))

Submission status: Runtime Error

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: Runtime Error

Solution code:
import strutils, sequtils
var n, a, b: int
(n, a, b) = stdin.readline.split.map(parseInt)
echo min(a, b), " ", max(0, a+b-n)

Submission status: Runtime Error

Solution code:
import sys
from collections import deque
input = sys.stdin.readline
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(n-1+m)]
tree_go = [[] for i in range(n+1)]
tree_come = [[] for i in range(n+1)]
excess = [0 for i in range(n+1)]
for a,b in ab:
  tree_go[a].append(b)
  tree_come[b].append(a)
for i in range(1,n+1):
  if tree_come[i] == []:
    root = i
  if len(tree_come[i]) >= 2:
    excess[i] = len(tree_come[i])-1
que = deque([(root,0)])
parent = [0 for i in range(n+1)]
visited = [0 for i in range(n+1)]
while que:
  x,px = que.popleft()
  parent[x] = px
  if excess[x] >= 1:
    excess[x] -= 1
    continue
  for y in tree_go[x]:
    que.append((y,x))
print(*parent[1:],sep="\n")

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;

int main(){
  int n,a,b,max,min;
  cin >> n;
  cin >> a;
  cin >> b;
  max = 0;
  min = 0;

  max = std::min({a,b});
  min = std::max({0,(a+b)-n});

  cout << max << " " << min << endl;
  return 0;

}

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
g=[[] for i in range(n)]
ro=[0]*n
for i in range(n+m-1):
    a,b=map(int,input().split())
    g[a-1].append(b)
    ro[b-1]+=1
for i in range(n):
    if ro[i]==0:
        r=i
ans=[0]*n
q=[r]
while len(q)>0:
    u=q.pop()
    for v in g[u]:
        ans[v-1]=u+1
        q.append(v-1)
for i in ans:
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, A, B= map(int, input().split())
print(min(N, A, B)
if A==B:
	print(A)
elif A>B:
	  print(A-B)
elif:
	  printt(B-A)
else:
      pass

Submission status: Runtime Error

Solution code:
import sys
# from heapq import heappop, heappush
from collections import deque
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

N, M = map(int, input().split())
check_lst = [0] * N
lst = [[] for _ in range(N)]
for _ in range(N + M - 1):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    lst[A].append(B)
    check_lst[B] += 1

n = check_lst.index(0)
ans = [0] * N
que = deque()
que.append(n)
while que:
    v = que.popleft()
    for v2 in lst[v]:
        check_lst[v2] -= 1
        if check_lst[v2] == 0:
            que.append(v2)
            ans[v2] = v + 1
print (*ans, sep = '\n')

Submission status: Runtime Error

Solution code:
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

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

    



if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(max_, min_)

Submission status: Runtime Error

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

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

print(max_, min_)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
dishes = []
for i in range(int(n)):
    tmp = [int(each) for each in input().split()]
    dishes.append((abs(tmp[0] - tmp[1]), tmp[0], tmp[1]))

dishes = sorted(dishes, key=lambda x: x[0], reverse=True)

point = [0, 0]
player = 0
while len(dishes) > 0:
    tmp_point = -1
    dish = None
    for tmp_dish in dishes:
        if dish is None:
            dish = tmp_dish
        elif tmp_point > dish[0]:
            break
        else:
            if dish[player + 1] > tmp_dish[player + 1] and tmp_dish[player + 1] - tmp_dish[int(not player) + 1] >= 0:
                dish = tmp_dish
            else:
                pass
    # print(dish)
    dishes.remove(dish)
    point[player] += dish[player + 1]
    player = int(not player)
print(point[0] - point[1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N = int(input())
As = input().split()

A = []

for Xs in As:
    A.append(int(Xs))


print(math.gcd, A)

# print(reduce(math.gcd, A))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
a,b,c  = input(),input(),input()
ans = 0
for i in range(n):
    strr = a[i] + b[i] + c[i]
    ans += len(set(strr))  - 1
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(input())
B=list(input())
C=list(input())
litter=[]
c=0
for s in range(N):
    c+=[0,0,1,2][len(set([A[s],B[s],C[s]]))]
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
list(n,x,y) = input().split(" ")
print(min(x,y),x+y-n)

Submission status: Runtime Error

Solution code:
Import numpy as np

N,A,B=[int(i) for i in input().split()]
x=min(A,B)
if((A+B)>N):
    z=N
    y=abs(A+B-z)
else:
    y=0
print("{} {}".format(x,y))

Submission status: Runtime Error

Solution code:
def main():
    raw = []
    for i in range(4):
        raw.append(input())

    n = int(raw[0])
    a = raw[1]
    b = raw[2]
    c = raw[3]

    difference = [0] * n
    for i in range(n):
        n = {a[i], b[i], c[i]}
        difference[i] = len(n) - 1

    print(sum(difference))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
I = int(input())
A = input()
B = input()
C = input()

count = 0
for i in range(I):
  if not (A[i]==B[i]==C[i]):
    count += 1 if A[i]==B[i] or B[i]== C[i] or A[i]==C[i] else 2

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np


class Person:
    def __init__(self, list_score_my, list_score_other, list_eatable):
        self.list_score_my = list_score_my
        self.list_score_other = list_score_other
        self.list_eatable = list_eatable
        self.eatable = True
        self.score_sum = 0

    # other
    def get_score_max_other(self):
        return np.max(self.list_score_other)

    def get_score_max_other_eatable(self):
        return np.max(self.list_score_other * self.list_eatable)

    def get_index_of_score_max_other_eatable(self):
        return np.where(self.list_score_other == self.get_score_max_other_eatable())

    def is_other_has_same_max_score(self):
        flag = 0
        score_other_max = np.max(self.list_score_other)
        for i in self.list_score_other:
            if(self.list_score_other[i] == self.score_other_max):
                flag += 1

        if(flag > 1):
            return True
        else:
            return False

    # my
    def get_score_max_my(self):
        return np.max(self.list_score_my)

    def get_score_max_my_eatable(self):
        return np.max(self.list_score_my * self.list_eatable)

    def get_index_of_score_max_my_eatable(self):
        return np.where(self.list_score_my == self.get_score_max_my_eatable())

    def is_i_have_same_max_score(self):
        flag = 0
        self.score_my_max = np.max(self.list_score_my)
        for i in range(len(self.list_score_my)):
            if(self.list_score_my[i] == self.score_my_max):
                flag += 1
        if(flag > 1):
            return True
        else:
            return False

    def eat(self, index):
        self.list_eatable[index] = False
        self.score_sum += self.list_score_my[index]

    def print_score(self):
        print(self.list_score_my)


def get_data(ryouri_goukei_num):
    list_score_a = np.empty(ryouri_goukei_num)
    list_score_b = np.empty(ryouri_goukei_num)
    list_ryouri_is_eatable = np.empty(ryouri_goukei_num)

    for i in range(ryouri_goukei_num):
        inputData = input()
        splitData = inputData.split()
        a_data = int(splitData[0])
        b_data = int(splitData[1])
        list_score_a[i] = a_data
        list_score_b[i] = b_data
        list_ryouri_is_eatable[i] = True

    return list_score_a, list_score_b, list_ryouri_is_eatable


def main():
    ryouri_goukei_num = int(input())
    list_score_a, list_score_b, list_ryouri_is_eatable = get_data(
        ryouri_goukei_num)

    takahashi = Person(list_score_a, list_score_b, list_ryouri_is_eatable)
    aoki = Person(list_score_b, list_score_a, list_ryouri_is_eatable)

    takahashi.print_score()
    aoki.print_score()

    for i in range(ryouri_goukei_num):
        if(takahashi.eatable):
            if(takahashi.is_i_have_same_max_score()):
                takahashi.eat(takahashi.get_index_of_score_max_other_eatable())
            else:
                takahashi.eat(takahashi.get_index_of_score_max_my_eatable())

            takahashi.eatable = False
            aoki.eatable = True
            list_ryouri_is_eatable = takahashi.eatable
            continue

        if(aoki.eatable):
            if(aoki.is_i_have_same_max_score()):
                aoki.eat(aoki.get_index_of_score_max_other_eatable())
            else:
                aoki.eat(aoki.get_index_of_score_max_my_eatable())

            takahashi.eatable = True
            aoki.eatable = False
            list_ryouri_is_eatable = aoki.eatable
            continue

    print(int(takahashi.score_sum - aoki.score_sum))


main()

Submission status: Runtime Error

Solution code:
n,a,b=int(input())
p = min(a,b)
q = max(a+b-n,0)
print(str(p) + " " + str(q))

Submission status: Runtime Error

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