Problem:


Score : 100 points

Problem Statement

There are a total of A + B cats and dogs.
Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.

Determine if it is possible that there are exactly X cats among these A + B animals.

Constraints

1 \leq A \leq 100

1 \leq B \leq 100

1 \leq X \leq 200

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B X

Output

If it is possible that there are exactly X cats, print YES; if it is impossible, print NO.

Sample Input 1

3 5 4

Sample Output 1

YES

If there are one cat and four dogs among the B = 5 animals, there are X = 4 cats in total.

Sample Input 2

2 2 6

Sample Output 2

NO

Even if all of the B = 2 animals are cats, there are less than X = 6 cats in total.

Sample Input 3

5 3 2

Sample Output 3

NO

Even if all of the B = 3 animals are dogs, there are more than X = 2 cats in total.



Sample input:
3 5 4


Sample output:
YES

Submission status: Runtime Error

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

if A <=X  and A+B >= X:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
a, b, x = map(int, input().split())
print('YES' if a<=c and x-a<=b else 'NO')

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
print('YES' if 0 < x-a < b else 'NO')

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
if (x-a)<=b:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
if (x-a)<b:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
    l=list(map(int,input().split()))
    print( "YES" if l[0]+l[1]>=l[2] else "NO")

Submission status: Runtime Error

Solution code:
a,b,c=int(input())
if a<=c<-a+b:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a,b,x-map(int,input().split())
if a<=x<=b:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

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

if c<=a+b:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

a.append(x)
a = sorted(a)

if len(a[:a.index(x)]) >= len(a[-(a.index(x)+1):]):
  print(len(a[-(a.index(x)+1):]))
else:
  print(len(a[:a.index(x)]))

Submission status: Runtime Error

Solution code:
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))

Submission status: Runtime Error

Solution code:
a,b,w = map(int,input().split())
print('YES' if a <= w <= a+b else:'NO')

Submission status: Runtime Error

Solution code:

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

N = max(a)

li = [abs(N/2 - k) for k in a]
index = li.index(min(li))

print("{0} {1}".format(N, a[index]))

Submission status: Runtime Error

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

if a <= x <= a+b:
:(tnirp )"SEY"
  :esle
    )"ON@"(tnir

Submission status: Runtime Error

Solution code:
A,B,X = map(int,input().split())
if A+B >=X and A<X:
  print('YES')
elif:
  print('NO')

Submission status: Runtime Error

Solution code:
a = list(map(int,input()))

if a[2]<a[0]:
  print("NO")
else:
  if a[2]<=a[0]+a[1]:
    print("YES")
  else:
    print("NO")

Submission status: Runtime Error

Solution code:
x = int(input())
 
if (x[1]-x[0]) < x[2]:
	print('YES')
else:
	print('NO')

Submission status: Runtime Error

Solution code:
x = int(input().split())
 
if (x[1]-x[0]) < x[2]:
	print('YES')
else:
	print('NO')

Submission status: Runtime Error

Solution code:
x = int(input().split())

if (x[1]-x[0]) < x[2]:
	print('YES):
else:
	print('NO')

Submission status: Runtime Error

Solution code:
A,B,X = map(int,input())


if(A<=X and X-A <= B):
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

cost0 = 0
costN = 0

for i in a:
    if i < x:
        cost0 += 1
    else:
        costN += 1

print(min(cost0, costN))

Submission status: Runtime Error

Solution code:
A,B,X = int(input().split())
if A < X and X < A+B:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
A,B,X = int(input())
if A < X and X < A+B:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a,b,x=map(int,input().split())
if a >= x:
  print("NO")
elif a+b <= x:
  print("NO")
else:
  print(YES)

Submission status: Runtime Error

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

if A > X:
  print("NO")
elif A+B < X:
  print("NO")
else:
  print("YES")

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input())
if a+b<c:
  print("No")
else:print("Yes")

Submission status: Runtime Error

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

if (a <= x) and (a + b >= x):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n = int(input())
input_num = input().split(" ")
sort_list = sorted(input_num)
center = int(n/2) - 1
for num in input_num:
    new_list = sort_list[0:]
    new_list.remove(num)
    print(new_list[center])

Submission status: Runtime Error

Solution code:
import sys


fin = sys.stdin.readline
n = int(fin())
a_list = sorted(int(elem) for elem in fin().split())

num_elems = a_list[-1]
num_choices = -1
max_diff = float('-inf')
for a in a_list[:-1]:
    diff = min(num_elems - a, a)
    if diff > max_diff:
        num_choices = a
        max_diff = diff

print(num_elems, num_choices)

Submission status: Runtime Error

Solution code:
A, B, X = int(x) for x in input().split()
if (A <= X) and ((A + B) >= X):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

if A <= X <= A+B:
    print("YES")
else:
    print("No")

Submission status: Runtime Error

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

n=int(input())
l=list(map(int,input().split()))
sl=l[:]
sl.sort()
a=sl[n//2-1]
b=sl[n//2]
for i in l:
  if i<=a:
    print(b)
  else:
    print(a)

Submission status: Runtime Error

Solution code:
input();a=sorted(list(map(int,input().split())));print(a[-1],sorted(a,key=lambda x:abs(a[-1]-2*x))[0])

Submission status: Runtime Error

Solution code:
input();a=list(map(int,input().split()))[::-1];print(a[0],min(sorted(a,key=lambda x:abs(a[0]-2*x))))

Submission status: Runtime Error

Solution code:
input();a=list(map(int,input().split()))[::-1];print(a[0],sorted(a,key=lambda x:abs(a[0]-2*x))[0])

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
if(a<=c and x<=a+b):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
A, B, X = map(int, input().split())

ans = "YES"
if A+B < X:
    ans = "NO"
elif:
    A > X:
        ans = "NO"
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
a,b,x = [int(x) for x in stdin.readline().rstrip().split()]
 
if a>x or:
  print('NO')
elif a<x and (x-a)>b:
  print('NO')
else:
  print('YES')

Submission status: Runtime Error

Solution code:
from sys import stdin
a,b,x = [int(x) for x in stdin.readline().rstrip().split()]

if a>x or:
  print('NO')
elif a<x and x-a>b:
  print('NO')
else:
  print('YES')

Submission status: Runtime Error

Solution code:
a, b, x = map(int, input())
if a <= x <= a+b:
    ans = "YES"
else:
    ans = "NO"
print(ans)

Submission status: Runtime Error

Solution code:
a,b,x = map(int,input().split())
print(["NO","YES"][(a+b>=c)*(a<=c)])

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
if x-a<=b and x>=a:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a,b,x = map(int,input().split())
print(["No","Yes"][(a+b>=c)*(a<=c)])

Submission status: Runtime Error

Solution code:
A, B, X = map(int,input().split())
if(A <= X and A+B => X):
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
if a+b>=c>=a
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
if a+b>=c and a<=c
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

print('NO' if X - A < 0 or X - A > B 'YES')

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
N,M,X = map(int,input().split()) #整数の入力
a = list(map(int,input().split()))
#検問所の入力
b=[]
c=[]
for i in range(X+1,N): #X+1からNの範囲の整数について 
  if i in a: #ある整数が検問所の整数として存在する
    b.append(1)
for i in range(1,X): #1からX-1の範囲の整数について
  if i in a: #ある整数が検問所の整数として存在する
    c.append(1)
print(min(sum(b),sum(c)))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
N,M,X = map(int,input().split()) #整数の入力
a = list(map(int,input().split()))
#検問所の入力
b=[]
c=[]
for i in range(X+1,N): #X+1からNの範囲の整数について 
  if i in a: #ある整数が検問所の整数として存在する
    b.append(1)
for i in range(1,X): #1からX-1の範囲の整数について
  if i in a: #ある整数が検問所の整数として存在する
    c.append(1)
print(min(sum(b),sum(c))

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
print('NO' if x<a or x>a+b else 'YES')

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
x=int(input())

if (a > x):
	print("No")
elif(a+b)>x:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
#include <iostream>
using namespace std;
int main(){
    int A,B,X;
    cin >> A >> B >> X;
    if( (B-X)>0 && (X-A)>=(B-X) )
    {
        cout<<"YES"<<endl;

    }
    else
    {
        cout<<"NO"<<endl;
    }

    return 0;
}

Submission status: Runtime Error

Solution code:
a,b,x=map(int,input(),split())
if 0<=x-a<=b:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n,m,x=map(int,input().split())

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

left=0
right=0

for ai in a:
    if ai<x:
        left+=1
    else:
        right+=1

print(min(left,right))

Submission status: Runtime Error

Solution code:
n=int(input())
A=list(map(int,input().split()))
A.sort()

a=A[-1]/2
tmp=A[-1]
ans=0
for i in range(n):
    if(abs(a-A[i]) < tmp):
        tmp=abs(a-A[i])
        ans=A[i]

print("{} {}".format(A[-1],ans))

Submission status: Runtime Error

Solution code:
import copy
n = int(input())
x = [int(y) for y in input().split()]
z = copy.deepcopy(x)
for i in range(n):
  x.pop(i)
  x.sort()
  print(x[int((n - 2) / 2)])
  x = z

Submission status: Runtime Error

Solution code:
A, B, C = map(int, input().split())
if X - A <= C:
	print('YES')
else:
	print('NO')

Submission status: Runtime Error

Solution code:
a,b,x=(int(i) for i in input.split(' '))
print("YES" if a<=x and x<=a+b else 'NO')

Submission status: Runtime Error

Solution code:
f

Submission status: Runtime Error

Solution code:
a,b,x=map(int,input().split())
if a>c or a+b<x:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
input_str = input()
input_list = input_str.split(' ')
a = input_list[0]
b = input_list[1]
c = input_list[2]
if a <= x:
    if x <= a + b:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if A <= X <= A + B:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if A <= X <= A + B:
  print('YES')
else:
  print('No')

Submission status: Runtime Error

Solution code:
input_a = input()
input_b = input()
input_x = input()
a = int(input_a)
b = int(input_b)
x = int(input_x)
if a < x:
    print("NO")
elif a+b < x:
    print("NO")
else:
    print("YES")

Submission status: Runtime Error

Solution code:
A, B, X = map(int, input.split())
if A + B < X:
    print("NO")
elif A > X:
    print("NO")
else :
    print("YES")

Submission status: Runtime Error

Solution code:
n,m,x = map(int,input().split())
A = list(map(int,input().split()))

ans1 = len([a for a in A if a < x])
ans2 = len([a for a in A if a > x])
print(min(ans1,ans2))

Submission status: Runtime Error

Solution code:
A,B,X = map(int,input().split)
if (A <= X <= (A + B)):
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
A,B,X = map(int,input())
if (A <= X <= (A + B)):
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
A,B,X=map(int,input().split())
if A+B<=X:
    if a<=X:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

Submission status: Runtime Error

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

if a > x:
	print("NO")
elif x - a > b:
	print("YES")
else:
	print("NO")

Submission status: Runtime Error

Solution code:
A,B,X = map(int,input().split())
print("Yes" if A < X and (A+B) > x else "No")

Submission status: Runtime Error

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

if a <= x and a + b >= x:
  print('YES')
else:
	print('NO)

Submission status: Runtime Error

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

for i in range(n):
    li.sort()
    a =  li[i]
    b = li[int((n+1)/2)]
    print(b)
    li.append(a)

Submission status: Runtime Error

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

for i in range(1,1+n):
    li.sort()
    a =  li[i]
    li.pop(i)
    b = li[int((n+1)/2)]
    print(b)
    li.append(a)

Submission status: Runtime Error

Solution code:
a,b,x = map(int(), input().split())
if a+b > x:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
x,y,z=map(int,input().split())
if x <= z and x+y => z :
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

t= [i for i in A if i> 0 and i< X]
s= [i for i in A if i> X and i <N]

print(min(len(t),len(s)))

Submission status: Runtime Error

Solution code:
n = int(input())
x = list(map(int,input().split()))
w = sorted(x)
l = int(n/2)
a = w[l - 1]
b = w[l]
for i in range(n):
	if x[i] <= a:
		print(b)
	else:
		print(a)

Submission status: Runtime Error

Solution code:
N = int(input())
X = list(map(int, input().split()))
meds = list(sorted(X))[N//2-1:N//2+1] # only necessary part
for x in X: # iterate sequence, not index
    if x <= meds[0]:
        print(meds[1])
    else:
        print(meds[0])

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
print(['YES','NO'][a>c||c>a+b])

Submission status: Runtime Error

Solution code:
    N = [int(i) for i in input().split()]
     
    if N[0] + N[1] >= N[2] and N[0] <= N[2]:
        print('YES')
    else:
        print('NO')

Submission status: Runtime Error

Solution code:
    a, b, x = map(int, input().split())
     
    if a <= x <= a + b:
        print("YES")
    else:
        print("NO")

Submission status: Runtime Error

Solution code:
    X=int(input())
    A=int(input())
    B=int(input())
    
    
    0<=B<=100
    if 0<=A<=100 and 0<=B<=100 and A<=X<=A+B;
    print("Yes")
    else;
    print("No")

Submission status: Runtime Error

Solution code:
X=int(input())
0<=A<=100
0<=B<=100
if A<=X<=A+B;
print("Yes")
else;
print("No")

Submission status: Runtime Error

Solution code:
N, M, X = map(int, input('N M X = ').split())
A = map(int, input('A_{i}(i=1,2,…,M)= ').split()) #int型で入力

setA = set(A) #list型をset型へ
s1 = range(0, X)
s2 = range(X, N+1)
a1 = set(s1) & (setA) #積集合
a2 = set(s2) & (setA)
cost1 = len(a1)
cost2 = len(a2)

if cost1 >= cost2:
    print(cost2)
else:
    print(cost1)

Submission status: Runtime Error

Solution code:
N, M, X = map(int, input('').split())
A = map(int, input('').split()) 

setA = set(A) 
s1 = range(0, X)
s2 = range(X, N+1)
a1 = set(s1) & (setA) 
a2 = set(s2) & (setA)
cost1 = len(a1)
cost2 = len(a2)

if cost1 >= cost2:
    print(cost2)
else:
    print(cost1)

Submission status: Runtime Error

Solution code:
cat, doccat, cat_much = input().split(" ")

If cat > cat_much:
    answer = "No"
elif cat == cat_much:
    answer = "no"
else cat < cat_much:
    elif cat + doccat >= cat_much:
        answer = "yes"
    else cat + doccat < cat_much

print(answer)

Submission status: Runtime Error

Solution code:
l = input().split()
n = int(l[0])
m = int(l[1])
x = int(l[2])
a = input().split()
i = 0
while(1):
    if int(a[i]) > x:
        break
    i = i + 1
if i < m - i:
    print(i)
else:
    print(m - i)

Submission status: Runtime Error

Solution code:
A,B,X = map(int, input().sp;it())
 
if (X>=A and X<=(A+B)):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a,b,c=map(int, input.split())
print("YES" if a<=c<=a+b else "NO")

Submission status: Runtime Error

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

if a>x:
    print('NO')
elif a+b<x:
    print('NO')
else:
    print('YES')

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
if a>c or a+b<c :
    print("NO")
else:
    print("YES")

Submission status: Runtime Error

Solution code:
import math

N = int(input())
number_list = list(map(int, input().split()))


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

max_value = 0
sort_number_list = sorted(number_list, reverse=True)

for i in range(len(sort_number_list)):
    for j in range(len(sort_number_list)):
        if sort_number_list[i] == sort_number_list[j]:
            continue
        if sort_number_list[i] > sort_number_list[j]:
            combinations_count_value = combinations_count(sort_number_list[i], sort_number_list[j])
            if max_value < combinations_count_value:
                max_value = combinations_count_value
                value_pair = [sort_number_list[i], sort_number_list[j]]

print('{} {}'.format(value_pair[0], value_pair[1]))

Submission status: Runtime Error

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

N = int(input())
number_list = list(map(int, input().split()))


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

max_value = 0
sort_number_list = sorted(number_list, reverse=True)

for i in range(len(sort_number_list)):
    for j in range(len(sort_number_list)):
        if sort_number_list[i] == sort_number_list[j]:
            continue
        if sort_number_list[i] > sort_number_list[j]:
            combinations_count_value = combinations_count(sort_number_list[i], sort_number_list[j])
            if max_value < combinations_count_value:
                max_value = combinations_count_value
                value_pair = [sort_number_list[i], sort_number_list[j]]

print('{} {}'.format(value_pair[0], value_pair[1]))

Submission status: Runtime Error

Solution code:
N = int(input())
list = list(map(int,input().split()))
#print(list)
sa_list = []
ai = max(list)
for i in range(N):
    sa2 = abs(( list[i] - ai/2 ) *2)
    
   #print(sa)
    sa_list.append(int(sa2))
#print(sa_list)
basyo = (sa_list.index(min(sa_list)))
ar = list[basyo]
if ai == ar:
    print(str(ai) + " " + str(ai - ar))
else:
    print(str(ai) + " " + str(ar))

Submission status: Runtime Error

Solution code:
A, B, X = map(int, raw_input().split(" "))
if A==X or (X-A)<=B: print("YES")
else: print("NO")

Submission status: Runtime Error

Solution code:
A, B, X = map(int, raw_input().split(" "))
if (X-A)<=B and X>A: print("YES")
else: print("NO")

Submission status: Runtime Error

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

if (a >= x) and (a+b <= X):
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
n = int(input())
x = [int(i) for i in input().split()]
for i in range(n):
    tmp = list(x)
    tmp[i] *= -1
    tmp.sort()
    median = int(n/2)
    print(tmp[median])

Submission status: Runtime Error

Solution code:
ipt1 = [int(i) for i in input().split()]
a = [int(i) for i  in input().split()]
n = ipt1[0]
m = ipt1[1]
x = ipt1[2]
cost_0 = 0
cost_n = 0
for i in range(m):
    if a[i] < x:
        cost_0 += 1
    else:
        cost_n += 1

print(int(min(cost_0, cost_n)))

Submission status: Runtime Error

Solution code:
ipt1 = [int(i) for i in input().split()]
a = [int(i) for i  in input().split()]
n = ipt1[0]
m = ipt1[1]
x = ipt1[2]
cost_0 = 0
cost_n = 0
for i in range(m):
    if a[i] < x:
        cost_0 += 1
    else:
        cost_n += 1

print(min(cost_0, cost_n))

Submission status: Runtime Error

Solution code:
a, b, x = input().split()
a = int(a)
b = int(b)
c = int(c)
if a <= x and a + b >= x:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
function main()
    a, b, x = split(readline())
    a = parse(Int, a)
    b = parse(Int, b)
    x = parse(Int, x)    
    if a <= x && a + b >= x
        println("YES")
    else
        println("NO")
    end
end
main()

Submission status: Runtime Error

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


def comb(n1, n2):
	result = 1
	for x in range(n1-n2+1,n1+1):
		result = result * x
	for x in range(1,n2+1):
		result = result / x
	return int(result)

numList = sorted(numList)
lastNum = numList[len(numList)-1]

if n > 2:
	if n%2 == 0:
		medIndex1 = int((n)/2)
		medIndex2 = medIndex1 - 1
		medNum1 = numList[medIndex1]
		medNum2 = numList[medIndex2]
		comb1 = comb(medNum1, lastNum)
		comb2 = comb(medNum2, lastNum)
		if comb1 > comb2:
			print(str(lastNum)+" "+str(medNum1))
		else:
			print(str(lastNum)+" "+str(medNum2))
	else:
		medIndex = int((n)/2)
		medNum = numList[medIndex]
		print(str(lastNum)+" "+str(medNum))
else:
	print(str(numList[1])+" "+str(numList[0]))

Submission status: Runtime Error

Solution code:
def comb(n, r):
    return f(n) / (f(n - r) * f(r)) 
 
def f(n):
    if n == 0:
        return 1
    else:
        return n * f(n - 1)
 
n = input()
a = map(int, raw_input().split())
 
a.sort()
a.reverse()
max = 0
ai = 0
aj = 0
for i in range(0, len(a)):
    for j in range(i + 1, len(a)):
        c = comb(a[i], a[j])
        if c > max:
            max = c
            ai = a[i]
            aj = a[j]
print(str(ai) + " " + str(aj))

Submission status: Runtime Error

Solution code:
a,b,c = lit(map(int, input().split()))
if a >= c and b >= c:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
n = int(input())
x = list(map(int,input().split()))
y = sorted(x)
x1, x2 = y[n//2-1], y[n//2]
for i, xx in enumerate(x):
    if xx<=x1:
        print(x2)
    else:
        print(x1)

Submission status: Runtime Error

Solution code:
n = int(input())
x = list(map(int,input().split()))
y = sorted(x)
x1, x2 = y[n//2-1], y[n//2]
for i, yy in enumerate(y):
    if yy<=x1:
        print(x2)
    else:
        print(x1)

Submission status: Runtime Error

Solution code:
import numpy as np
import copy

n = int(input())
xs = list(map(int,input().split()))
sort_xs = sorted(xs)

for x in xs:
    ind = sort_xs.index(x)
    new_sort_xs = copy.deepcopy(sort_xs)
    del new_sort_xs[ind]
    if ind > (n/2) + 1:
        print(new_sort_xs[int(n/2)])
    else:
        print(new_sort_xs[int(n/2)-1])

Submission status: Runtime Error

Solution code:
n=int(input())
x=map(int,input().split())
y = sorted(x)
x1, x2 = y[n//2-1], y[n//2]
for i in range(n):
    if x[i]<=x1:
        print(x2)
    else:
        print(x1)

Submission status: Runtime Error

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


mid_dis = [abs(a[n-1] / 2 - a[i]) for i in range(n-1)]
arg_max_i = [i for i in range(n-1) if mid_dis[i] == min(mid_dis)][0]

print(a[n-1], a[arg_max_i])

Submission status: Runtime Error

Solution code:
a,b,c = map(int, input().split())
if a+b>=c>=a:
  print(YES)
else
 print(NO)

Submission status: Runtime Error

Solution code:
N = int(input())
X = list(map(int, input().split()))
Y = sorted(X)

for i in range(len(X)):
    candi = Y[int(N/2)-1]
    if X[i] <= candi:
        print(Y[int(N/2)])
    else:
        print(Y[int(N/2)-1])

Submission status: Runtime Error

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

elif a<=x and x<=a+b:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
if x >= a and x-a <= b:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
N,M,X=map(int,input().split())
A=list(map(int,input().split()))
l, h =0,0
for i in range(M):
  if A[i]<X:l+=1
  if A[i]>X:h+=1
print(min(l,h))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
ai = max(a)
aj = min(filiter(lambad x: x!=ai, a), key=lambda x: abs(x-ai//2))
print("{} {}".format(ai, aj))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split(' ')))
i = 0
for i in range(n):
    ai = a[0:i] + a[i+1:n]
    aisrt = sorted(ai)
    l = int(len(aisrt)/2)
    print(aisrt[l])

Submission status: Runtime Error

Solution code:
n = int(input())
x = map(int, input().split())
temp = sorted(zip(x, range(n)))
ans = [None] * n
for i in range(n):
    idx = n//2
    if i >= idx:
        idx -= 1
    ans[temp[i][1]] = temp[idx][0]
for item in ans:
    print(item)

Submission status: Runtime Error

Solution code:
# coding=utf-8
a, b, x = map(int, input().split())
if a <= x and x<= a+b:
    print(“Yes”)
else:
    print(“No”)

Submission status: Runtime Error

Solution code:
A, B, X=list(map(int,input().split()))
if B>=X-A&X-A>=0:
 　print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 17 14:45:17 2018

@author: kitamura
"""

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

for i in range(N):
    M=[]
    for j in range(N):
        if j==i:
            continue
        M.append(X[j])
    M.sort()
#    print(M)
    print(M[(int(N/2))-1])

Submission status: Runtime Error

Solution code:
n, m, x = map(int, input().split(' '))
ai = map(int, input().split(' '))
lcost = 0
rcost = 0
for gate in ai:
  if gate < x:
    lcost += 1
  else:
    rcost += 1

print(min(lcost, rcost))

Submission status: Runtime Error

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

a.sort()

old = 0
for item in a[:-1]:
    if abs(old - a[-1]/2) <= abs(item - a[-1]/2):
        print(a[-1], old)
        break
    old = item

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
x = int(input())

if a <= x <= a + b:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
n = int(input())
x = list(map(int, input().split()))
sx = sorted(x)

min_mid = sx[int(n/2-1)]
max_mid = sx[int(n/2)]

for i in x:
    if i <= min_mid:    # 左半分から取られてる時
        print(max_mid)
    else:               # 右半分から取られてる時
        print(min_mid)

Submission status: Runtime Error

Solution code:
A, B, X = map(int, raw_input().split())
print("YES" if A<=X<=A+B else "NO")

Submission status: Runtime Error

Solution code:
n = int(input())
x = list(map(str, input().split()))
sx = sorted(x)

max_mid = sx[int(n/2)]
min_mid = sx[int(n/2-1)]

for i in x:
    if i <= min_mid:    # 左半分から取られてる時
        print(max_mid)
    else:               # 右半分から取られてる時
        print(min_mid)

Submission status: Runtime Error

Solution code:
A,B,X = map (int,input().split())
if A+B>=X and not A>X :
	print "YES"
else:
	print "NO"

Submission status: Runtime Error

Solution code:
A,B,X = map (int,input().split())
if A+B>=X and not A>X
	print "YES"
else
	print "NO"

Submission status: Runtime Error

Solution code:

n = int(input())
x_str = input().split()
xs = [int(c) for c in x_str]

xs_len = len(xs)
center = (xs_len - 1)//2

c_xs = xs[:]
c_xs.sort()

for x in xs:
    print(c_xs[center+1] if x <= c_xs[center] else c_xs[center])

Submission status: Runtime Error

Solution code:

n = int(input())
x_str = input().split()
x = [int(c) for c in x_str]

l_ = len(x) - 1

for i in range(len(x)):
    copy_x = x[:]
    copy_x.pop(i)
    copy_x.sort()
    print(copy_x[(l_)//2])

Submission status: Runtime Error

Solution code:
N=int(input())
X=[int(i) for i in input().split()]
for i in range(N):
  x=X.copy()
  del x[i]
  x.sort()
  print(x[N//2-1])

Submission status: Runtime Error

Solution code:


n = int(input())

number_list = list(map(int,input().split()))
tmp_list = sorted(number_list)


for number in number_list:
    if number < tmp_list[n//2]:
        print(tmp_list[n//2])
    else :
        print(tmp_list[n//2-1])

Submission status: Runtime Error

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

if X >= A and X <= A + B:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

import numpy

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

if a[0] > a[2]:
        print("NO")
elif a[0]+a[1] < a[2]:
        print("NO")
else:
        print("YES")

Submission status: Runtime Error

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

import numpy

a = map(int,input.split(","))

if a[0] > a[2]:
        print("NO")
elif a[0]+a[1] < a[2]:
        print("NO")
else:
        print("YES")

Submission status: Runtime Error

Solution code:
import math

def comb(a, b):
	return int(math.factorial(a) / math.factorial(b) / math.factorial(a-b))

if __name__ == '__main__':
	n = int(input())
	a = [int(x) for x in input().split(' ')]

	sa = sorted(a)

	oldcmb = -float('inf')
	oldi, oldj = (-1, -1)
	i, j = (-1, -1)
	for i in range(n):
		for j in range(n):
			if i == j or i < j:
				break
			cmb = comb(sa[i], sa[j])
			# print('old:{} new:{}[{}][{}]'.format(oldcmb, cmb, i, j))
			if cmb > oldcmb:
				oldcmb = cmb
				oldi, oldj = (i, j)
		if j == n-1:
			break

	print('{} {}'.format(sa[oldi], sa[oldj]))
	# print('{}:{} {}:{}'.format(oldi, sa[oldi], oldj, sa[oldj]))

Submission status: Runtime Error

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

import copy
X_sort=copy.deepcopy(X)
X_sort.sort()
X_sort

median_control=(X_sort[N//2-1]+X_sort[N//2])/2
for i in range (N):
    if X[i]>median_control:
        print (X_sort[N//2-1])
    if X[i]<=median_control:
        print (X_sort[N//2])

Submission status: Runtime Error

Solution code:

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

sortedx = x[:]
sortedx.sort()

for i in range(n):
    #ix = sortedx.index(x[i])
    #print(sortedx)
    #print(ix)
    if x[i] <= sortedx[n//2-1]:
        print(sortedx[n//2])
    else:
        print(sortedx[n//2-1])

Submission status: Runtime Error

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

sortedx = x[:]
sortedx.sort()

for i in range(n):
    #ix = sortedx.index(x[i])
    #print(sortedx)
    #print(ix)
    if x[i] <= sortedx[n//2-1]:
        print(sortedx[n//2-1])
    else:
        print(sortedx[n//2-2])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*
n = int(raw_input())
x =[]
x = map(int, raw_input().split())

for i in range(n):
 copyx = list(x)
 del copyx[i]
 copyx.sort()
 b = copyx[int((n-1)/2)]
 print(b)

Submission status: Runtime Error

Solution code:
n = int(input())

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

soredx = sorted(x)

migi = soredx[int(n/2-1)]
hidari = soredx[int(n/2)]

for i in range(n):
    if(migi<x[i]):
        print(migi)
    else:
        print(hidari)

Submission status: Runtime Error

Solution code:
n=int(input())
a1=input().split()
tag_list=()
dic={}
for i in a1:
    tag_list.append(int(i))
 
for j in range(0,n):
    numnum=tag_list[j]
    if numnum in dic:
        print(dic[numnum])
    else:
        A=list(tag_list)
        A.pop(j)
        A.sort()
        num=int(n/2-1)
        print(A[num])
        dic[numnum]=A[num]

Submission status: Runtime Error

Solution code:
N,M,X=map(int, input().split())
A = list(int(M) for M in input().split())
i = 0
for i in range(M):
    if A[i]>X:
        i = i+1
print(i)