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:
import copy
n = int(input())
N = int(n/2-1)
x = list(map(int, input().split()))
y = sorted(x)

for i in range(n):
    Y  = copy.deepcopy(y)
    Y.remove(x[i])
    print(Y[N)

Submission status: Runtime Error

Solution code:
n=int(input())
a1=input().split()
tag_list=[]
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=tag_list[0:j]
        test=tag_list[j+1:n]
        A.extend(test)
        A.sort()
        num=int(n/2-1)
        print(A[num])
        dic[numnum]=A[num]

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import copy
# スペース区切りの整数の入力
N = int(input())
X = list(map(int, input().split()))
md = int(N/2)
d = {}
for x in X:
    if x in d:
        d[x] += 1
    else:
        d[x] = 1

for i in range(N):
    d_cp = copy.deepcopy(d)
    d_cp[X[i]] += -1
    sum_w = 0
    cum = []
    for i, key in enumerate(d_cp):
        sum_w += d_cp[key]
        cum.append([i,key,sum_w])
    for i,key,c in cum:
        if c >= md:
            print(key)
            break

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import copy
# スペース区切りの整数の入力
N = int(input())
X = list(map(int, input().split()))
md = int(N/2)
d = {}
for x in X:
    if x in d:
        d[x] += 1
    else:
        d[x] = 1

for i in range(N):
    d_cp = copy.deepcopy(d)
    d_cp[X[i]] += -1 
    sum_w = 0
    cum = []
    for i, key in enumerate(d_cp):
        sum_w += d_cp[key]
        cum.append([i,key,sum_w])
    for i,key,c in cum:
        if c >= md:
            print(key)
            break

Submission status: Runtime Error

Solution code:
A,B,C=map(int, iput().split())
if C>A && A+B>C:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

for i in range(n):
    Y  = copy.deepcopy(y)
    Y.remove(x[i])
    print(Y[int(n/2 -1)])

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
X_list = list(map(int, input().split()))
def get_median(a_list, i):
    b_list = a_list[:]
    del b_list[i]
    data = np.array(b_list)
    print(np.median(data))
for j in range(N):
    get_median(X_list, j)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()
a_i = a[-1]
max = 0
b = 0
from scipy.misc import comb
for i in a[0:-2]:
    buf = comb(a_i,i)
    if max < buf:
        max = buf
        b = i
    else:
        break
print("{} {}".format(a_i, b))

Submission status: Runtime Error

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

for i in range(n):
    x_in  = copy.deepcopy(x)
    del x_in[i]
    x_in.sort()
    print(x_in[int(n/2 -1)])
    x_in  = []

Submission status: Runtime Error

Solution code:
# coding : utf-8

import numpy as np

A = [int(i) for i in input().split()]

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

Submission status: Runtime Error

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

if A>X or B>X :
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
inputs = list(map(int,input()))
a = inputs[1]
b = inputs[2]
c = inputs[3]

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

Submission status: Runtime Error

Solution code:
import copy

N=int(input())
X=list(map(int,input().split(" ")))
Y=copy.deepcopy(X)
Y.sort()
Y1=Y[:N//2]
Y2=Y[N//2:]
a=Y[N//2]
b=Y[N//2-1]
for i in X:
  if i in Y1:
    print(a)
  else:
    print(b)

Submission status: Runtime Error

Solution code:
list = map(int, raw_input().split())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

def main():
    n, m, x = map(int, input().split())
    a = list(map(int, input().split()))
    print(min(len([b for b in a if b < x]), len([b for b in a if b > x])))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if X - A > = 0 and A + B >= X:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
l = map(int, raw_input().split())
A, B, X = l[0], l[1], l[2]

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())
if A>X:
    print("NO")
elif A<=X=<A+B:
    print("YES")
else :
    print("NO")

Submission status: Runtime Error

Solution code:
mport sys
import copy

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [A, B, X] = [int(input_raw[0]), int(input_raw[1]), int(input_raw[2])]
    if A + B >= X and A <= X:
        print 'YES'
    else:
        print 'NO'

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
aa,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 = int(input())
B = int(input())

X = int(input())

value = X - A

if value < 0:
    print('NO')
elif value < B:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
typedef priority_queue <int> pi;
typedef priority_queue <int, vector<int>, greater<int>> pg;
typedef unsigned long long int ulli;

int main() {
    int A, B, X;
    cin >> A >> B >> X;
    X -= A;
    if(A < B) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}

Submission status: Runtime Error

Solution code:
l = map(int, raw_input().split())
if l[0]+l[1]<l[2]:
    print('YES')
else:
    print('NO')