TnT/CodeNet4Repair huggingface dataset:
Problem:
You are given positive integers X and Y. If there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it. If it does not exist, print -1.

Incorrect submission (verdict: Wrong Answer):
import math

input = str(input()).split(" ")
for index in range(len(input)):
    input[index] = int(input[index])
x = input[0]
y = input[1]


def test(x, y):
    for index in range(-abs(y), abs(y) + 1):
        if (x * index % y != 0 and abs(x * index) <= 10**(18)):
            return x * index
    return -1
print(test(x,y))


Fixed, accepted submission:
import math
x, y = map(int, input().split())
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

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

def thingo(x,y):
    if (x == 0 and y == 0):
        return -1
    if (x != 0 and y == 0):
        return x
    test = lcm(x,y)
    if (test-x >= x):
        return test-x
    else:
        return -1
print(thingo(x,y))
Problem:
There are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.  Only Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from the top rank down. Participants who are not students cannot pass the Qualification contests.    * A Japanese student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B.   * An overseas student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B and the student ranks B-th or above among all overseas students.  A string S is assigned indicating attributes of all participants. If the i-th character of string S is `a`, this means the participant ranked i-th in the Qualification contests is a Japanese student; `b` means the participant ranked i-th is an overseas student; and `c` means the participant ranked i-th is neither of these.  Write a program that outputs for all the participants in descending rank either `Yes` if they passed the Qualification contests or `No` if they did not pass.

Incorrect submission (verdict: Wrong Answer):
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, A, B = input_number_list()
    S = input()
    total = 0
    total_f = 0
    for c in S:
        isNg = False
        if c == 'a' and total < A + B:
            total += 1
        elif c == 'b' and total < A + B and total_f < B:
            total += 1
            total_f += 1
        else:
            isNg = True
        print('YNeos'[isNg::2])


if __name__ == '__main__':
    main()


Fixed, accepted submission:
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, A, B = input_number_list()
    S = input()
    total = 0
    total_f = 0
    for c in S[:-1]:
        isNg = False
        if c == 'a' and total < A + B:
            total += 1
        elif c == 'b' and total < A + B and total_f < B:
            total += 1
            total_f += 1
        else:
            isNg = True
        print('YNeos'[isNg::2])


if __name__ == '__main__':
    main()
Problem:
Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.  The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)  Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?

Incorrect submission (verdict: Wrong Answer):
X = int(input())
B = 100
while (B>X):
  B = B + B*0.01
print(int(B))

Fixed, accepted submission:
X = int(input())
year = 0
deposit = 100
while deposit < X:
    deposit = deposit*101//100
    year += 1
print(year)
Problem:
There are N positive integers written on a blackboard: A_1, ..., A_N.  Snuke can perform the following operation when all integers on the blackboard are even:    * Replace each integer X on the blackboard by X divided by 2.  Find the maximum possible number of operations that Snuke can perform.

Incorrect submission (verdict: Wrong Answer):
N=int(input())
A=list(map(int,input().split()))
ans=0
f=1
while(f):
    for i in range(len(A)):
        if A[i]%2==0:A[i]/=2
        else: f=0
    ans+=1
print(ans)


Fixed, accepted submission:
N=int(input())
A=list(map(int,input().split()))
ans=-1
f=1
while(f):
    for i in range(len(A)):
        if A[i]%2==0:A[i]/=2
        else: f=0
    ans+=1
print(ans)
Problem:
It is September 9 in Japan now.  You are given a two-digit integer N. Answer the question: Is 9 contained in the decimal notation of N?

Incorrect submission (verdict: Wrong Answer):
n=input()
n=int(n)
og=n
flag=0
while(n>0):
    d=n%10
    n=n//10
    if(d==7):
        flag=flag+1
        
if(flag>0):
    print("Yes")
else:
    print("No")
    
          
          

    


Fixed, accepted submission:
n=input()
n=int(n)
og=n
flag=0
while(n>0):
    d=n%10
    n=n//10
    if(d==9):
        flag=flag+1
        
if(flag>0):
    print("Yes")
else:
    print("No")
Problem:
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i).  A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, and the y-coordinate of the red point is also smaller than that of the blue point.  At most how many friendly pairs can you form? Note that a point cannot belong to multiple pairs.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
red = [list(map(int, input().split())) for i in range(N)]
blue = [list(map(int, input().split())) for i in range(N)]
l = [0] * N
def c(a,b):
    if a[0] < b[0] or a[1] < b[1]:return True
    return False
for r in red:
    m = 10000000
    mi = -1
    for i, b in enumerate(blue):
        if l[i]: continue
        if not c(r, b):continue
        tmp = sum([(a-b2)**2 for a,b2 in zip(r, b)])
        if m > tmp:
            mi = i
            m = tmp
    if mi != -1:
        l[mi] = 1
print(sum(l))

Fixed, accepted submission:
N = int(input())
red = [list(map(int, input().split())) for i in range(N)]
blue = [list(map(int, input().split())) for i in range(N)]
a = [0] * N
for x,y in sorted(blue,key=lambda x: x[0]):
    k = []
    for i,[x2,y2] in enumerate(red):
        if x2 < x and y2 < y and not a[i]:
            k.append((x2,y2,i))
    if len(k):
        x,y,i=sorted(k,key=lambda x:-1*x[1])[0]
        a[i] = 1
print(sum(a))
Problem:
販売単価と販売数量を読み込んで、販売金額の総合計と販売数量の平均を出力するプログラムを作成してください。

Incorrect submission (verdict: Wrong Answer):
import sys
x,y = 0,0
n = 0
for line in sys.stdin.readlines():
  print(line)
  a,b = map(int,line.split(','))
  x += a*b
  y += b
  n += 1
print(x)
print(int(y/n))

Fixed, accepted submission:
import sys

count = 0
asum = 0
bsum = 0
for line in sys.stdin:
  count += 1
  l = list(map(int,line.split(",")))
  asum += l[0]*l[1]
  bsum += l[1]
bave = int(bsum / count + 0.5)

print(asum)
print(bave)
Problem:
You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.

Incorrect submission (verdict: Wrong Answer):
a,b = map(int, input().split())
print((a+b)/2%1)

Fixed, accepted submission:
a,b = map(int, input().split())
print(int((a+b+2-1)/2))
Problem:
AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he checked it for the i-th (1≦i≦N) time, the ratio was T_i:A_i. It is known that each candidate had at least one vote when he checked the report for the first time.  Find the minimum possible total number of votes obtained by the two candidates when he checked the report for the N-th time. It can be assumed that the number of votes obtained by each candidate never decreases.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=[list(map(int,input().split())) for i in range(n)]
x,y = a[0][0],a[0][1]
for i in range(1,n):
  xr=(a[i-1][0]+a[i][0]-1)//a[i][0]
  yr=(a[i-1][1]+a[i][1]-1)//a[i][1]
  r=max(xr,yr)
  x*=r
  y*=r
print(x+y)

Fixed, accepted submission:
n=int(input())
a=[list(map(int,input().split())) for i in range(n)]
x,y = a[0][0],a[0][1]
for i in range(1,n):
  xr=(x+a[i][0]-1)//a[i][0]
  yr=(y+a[i][1]-1)//a[i][1]
  r=max(xr,yr)
  x=r*a[i][0]
  y=r*a[i][1]
print(x+y)
Problem:
There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?

Incorrect submission (verdict: Wrong Answer):
N = int(input())

print(N * (N+1)/2)

Fixed, accepted submission:
N = int(input())
 
print(int(N * (N+1)/2))
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):

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

print("YES" if A==B==5 and B==C==5 and A==C==5 else "NO")


Fixed, accepted submission:

A, B, C = input().split()
list = [A, B, C]
print("YES" if list.count("5")==2 and list.count("7")==1 else "NO")
Problem:
M-kun has the following three cards:    * A red card with the integer A.   * A green card with the integer B.   * A blue card with the integer C.  He is a genius magician who can do the following operation at most K times:    * Choose one of the three cards and multiply the written integer by 2.  His magic is successful if both of the following conditions are satisfied after the operations:    * The integer on the green card is **strictly** greater than the integer on the red card.   * The integer on the blue card is **strictly** greater than the integer on the green card.  Determine whether the magic can be successful.

Incorrect submission (verdict: Wrong Answer):
a,b,c=map(int,input().split())
k=int(input())
while k>0:
    if a>=b:
        b*=2
    elif b>=c:
        c*=2
    else:
        break
    k-=1
if a<b and b<c:
    print("YES")
else:
    print("NO")

Fixed, accepted submission:
a,b,c=map(int,input().split())
k=int(input())
while k>0:
    if a>=b:
        b*=2
    elif b>=c:
        c*=2
    else:
        break
    k-=1
if a<b and b<c:
    print("Yes")
else:
    print("No")
Problem:
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.    An example of a trapezoid  Find the area of this trapezoid.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
ans=0
for i in range(n):
    ans+=i+1

print(ans)


Fixed, accepted submission:
a=int(input())
b=int(input())
c=int(input())

print((a+b)*c//2)
Problem:
You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:    * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`.

Incorrect submission (verdict: Wrong Answer):
s = input()

mojiretu = ['dream','dreamer','erase','eraser']

import re
def setudan(s):
  if s[-5:] == 'dream' or s[-5:] == 'erase':
    return s[:-5]
  elif s[-6:] == 'eraser':
    return s[:-6]
  elif s[-7:] == 'dreamer':
    return s[:-7]
  else:
    return 0

while True:
  s = setudan(s)
  if s == 0:
    print('No')
    break
  if s =='':
    print('Yes')
    break

Fixed, accepted submission:
s = input()

mojiretu = ['dream','dreamer','erase','eraser']

import re
def setudan(s):
  if s[-5:] == 'dream' or s[-5:] == 'erase':
    return s[:-5]
  elif s[-6:] == 'eraser':
    return s[:-6]
  elif s[-7:] == 'dreamer':
    return s[:-7]
  else:
    return 0

while True:
  s = setudan(s)
  if s == 0:
    print('NO')
    break
  if s =='':
    print('YES')
    break
Problem:
A string is called a KEYENCE string when it can be changed to `keyence` by removing its contiguous substring (possibly empty) only once.  Given a string S consisting of lowercase English letters, determine if S is a KEYENCE string.

Incorrect submission (verdict: Wrong Answer):
S = input()
N = len(S)

if S == "keyence":
    print("YES")
    exit()

for i in range(N):
    for j in range(i, N):
        s = S[:i] + S[j + 1:]
        print(s)
        if s == "keyence":
            print("YES")
            exit()

print("NO")


Fixed, accepted submission:
S = input()
N = len(S)

if S == "keyence":
    print("YES")
    exit()

for i in range(N):
    for j in range(i, N):
        s = S[:i] + S[j + 1:]
        # print(s)
        if s == "keyence":
            print("YES")
            exit()

print("NO")
Problem:
Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.  The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)  Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?

Incorrect submission (verdict: Time Limit Exceeded):
x = int(input())
d = 0
ans = 0
while d < x:
  d += d//100
  ans += 1
print(ans)

Fixed, accepted submission:
x = int(input())
d = 100
ans = 0
while d < x:
  d += d//100
  ans += 1
print(ans)
Problem:
There are N positive integers written on a blackboard: A_1, ..., A_N.  Snuke can perform the following operation when all integers on the blackboard are even:    * Replace each integer X on the blackboard by X divided by 2.  Find the maximum possible number of operations that Snuke can perform.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

cnt = 0
while 1:
    if all(a[i] % 2 == 0 for i in range(n)):
        for i in range(n):
            a[i] = a[i] // 2
            print(a)
        cnt += 1
    else:
        break
print(cnt)

Fixed, accepted submission:
import sys

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

cnt = [0] * n

while 1:
    for i in range(n):
        if a[i] % 2 == 0:
            a[i] /= 2
            cnt[i] += 1
        else:
            print(min(cnt))
            sys.exit()
Problem:
You are given an H × W grid.   The squares in the grid are described by H strings, S_1,...,S_H.   The j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \leq i \leq H,1 \leq j \leq W).   `.` stands for an empty square, and `#` stands for a square containing a bomb.  Dolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.   (Below, we will simply say "adjacent" for this meaning. For each square, there are at most eight adjacent squares.)   He decides to replace each `.` in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.  Print the strings after the process.

Incorrect submission (verdict: Wrong Answer):
import numpy as np
line = input().split()
h = int(line[0])
w = int(line[1])
grid = []
for i in range(h):
  grid.append(list(input()))
              
grid = np.array(grid)


def get8(grid,y,x):
  v = [None]*8
  try :
    if y < 0 :
      pass
    else:
      v[0] = grid[y-1][x]
  except :
    pass
  try :
    if y-1 < 0 :
      pass
    else :
      v[1] = grid[y-1][x+1]
  except :
    pass  
  try :
    v[2] = grid[y][x+1]
  except :
    pass
  try :
    v[3] = grid[y+1][x+1]
  except :
    pass
  try :
    v[4] = grid[y+1][x]
  except :
    pass
  try :
    if x-1 < 0 :
      pass
    else:
      v[5] = grid[y+1][x-1]
  except :
    pass
  try :
    if x-1 < 0 :
      pass
    else:
      v[6] = grid[y][x-1]
  except :
    pass
  try :
    if y-1 < 0 or x-1 < 0 :
      pass
    else :
    	v[7] = grid[y-1][x-1]
        
  except :
    pass
  
  return v

for i in range(h) :
  for j in range(w) :
    v = get8(grid,i,j)
    if i== 3 and j == 0 :
      print(v)
    if grid[i][j] == "." :
    	grid[i][j] = v.count("#")
  
  
print(grid) 
  
  
  

Fixed, accepted submission:
import numpy as np
line = input().split()
h = int(line[0])
w = int(line[1])
grid = []
for i in range(h):
  grid.append(list(input()))
              
grid = np.array(grid)


def get8(grid,y,x):
  v = [None]*8
  try :
    if y-1 < 0 :
      pass
    else:
      v[0] = grid[y-1][x]
  except :
    pass
  try :
    if y-1 < 0 :
      pass
    else :
      v[1] = grid[y-1][x+1]
  except :
    pass  
  try :
    v[2] = grid[y][x+1]
  except :
    pass
  try :
    v[3] = grid[y+1][x+1]
  except :
    pass
  try :
    v[4] = grid[y+1][x]
  except :
    pass
  try :
    if x-1 < 0 :
      pass
    else:
      v[5] = grid[y+1][x-1]
  except :
    pass
  try :
    if x-1 < 0 :
      pass
    else:
      v[6] = grid[y][x-1]
  except :
    pass
  try :
    if y-1 < 0 or x-1 < 0 :
      pass
    else :
    	v[7] = grid[y-1][x-1]
        
  except :
    pass
  
  return v

for i in range(h) :
  for j in range(w) :
    v = get8(grid,i,j)
    if grid[i][j] == "." :
    	grid[i][j] = v.count("#")
  
  
for i in range(h) :
  print("".join(grid[i]))
Problem:
There is a hotel with the following accommodation fee:    * X yen (the currency of Japan) per night, for the first K nights   * Y yen per night, for the (K+1)-th and subsequent nights  Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee.

Incorrect submission (verdict: Wrong Answer):
# -*- coding: utf-8 -*-

n = int(input())
k = int(input())
x = int(input())
y = int(input())

print((n * x) + ((n - k) * y if (n - k) > 0 else 0))

Fixed, accepted submission:
# -*- coding: utf-8 -*-



n = int(input())
k = int(input())
x = int(input())
y = int(input())

diff = y - x

p_x = x * n
p_y = diff * (n - k) if (n - k) > 0 else 0

print(p_x + p_y)




#print(p_x + p_y)
Problem:
An elementary school student Takahashi has come to a variety store.  He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?  Note that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.

Incorrect submission (verdict: Wrong Answer):
a, b, c = map(int, input().split())

if a + b < c:
    print("Yes")

else:
    print("No")
    

Fixed, accepted submission:
a, b, c = map(int, input().split())

if a + b < c:
    print("No")

else:
    print("Yes")
Problem:
There is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either `.` or `*`. The character representing the pixel at the i-th row from the top and the j-th column from the left, is denoted by C_{i,j}.  Extend this image vertically so that its height is doubled. That is, print a image with a height of 2H pixels and a width of W pixels where the pixel at the i-th row and j-th column is equal to C_{(i+1)/2,j} (the result of division is rounded down).

Incorrect submission (verdict: Wrong Answer):
H, W = map(int, input().split())
C = [[j for j in input()] for i in range(H)]
C2 = [['' for j in range(W)] for i in range(2*H)]
for i in range(2*H):
    for j in range(W):
        C2[i][j] = C[i//2][j]
for i in range(2*H):
    print(*C2[i])

Fixed, accepted submission:
H, W = map(int, input().split())
C = [[j for j in input()] for i in range(H)]
C2 = [['' for j in range(W)] for i in range(2*H)]
for i in range(2*H):
    for j in range(W):
        C2[i][j] = C[i//2][j]
for i in range(2*H):
    print(''.join(C2[i]))
Problem:
_n_ _q_   _name 1 time1_   _name 2 time2_   ...   _name n timen_    In the first line the number of processes _n_ and the quantum _q_ are given separated by a single space.  In the following _n_ lines, names and times for the _n_ processes are given. _name i_ and _time i_ are separated by a single space.

Incorrect submission (verdict: Wrong Answer):
pnum,mtime = map(int,input().split(" "))

total = [list(input().split(" ")) for _ in range(pnum)]

print(total)

cnt=0
tcnt=0
while len(total) > 0:
	ztime = int(total[0][1]) - mtime
	if ztime <= 0:
		tcnt += int(total[0][1])
		print(total[0][0],int(tcnt))
		total.pop(0)
	else:
		total.append([total[0][0],ztime])
		total.pop(0)
		tcnt += mtime
	cnt += 1



Fixed, accepted submission:

from collections import deque

pnum,mtime = map(int,input().split(" "))

q = deque([])
[q.append(input().split(" ")) for u in range(pnum)]

tcnt=0
while len(q) > 0:
	qq = q.popleft()
	ztime = int(qq[1]) - mtime
	if ztime <= 0:
		tcnt += int(qq[1])
		print(qq[0],int(tcnt))
	else:
		q.append([qq[0],ztime])
		tcnt += mtime
Problem:
You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:    * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`.

Incorrect submission (verdict: Wrong Answer):
s = input()

kouho = ["dream", "dreamer", "erase", "eraser"]

s.replace(kouho[0], "").replace(kouho[1], "").replace(kouho[2], "").replace(kouho[3], "")

if s == "":
    print("YES")
else:
    print("NO")

Fixed, accepted submission:
s = input()
 
kouho = ["dream", "dreamer", "erase", "eraser"]
 
s = s.replace(kouho[3], "").replace(kouho[2], "").replace(kouho[1], "").replace(kouho[0], "")
 
if s == "":
    print("YES")
else:
    print("NO")
Problem:
Our world is one-dimensional, and ruled by two empires called Empire A and Empire B.  The capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.  One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.  If there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.    * X < Z \leq Y   * x_1, x_2, ..., x_N < Z   * y_1, y_2, ..., y_M \geq Z  Determine if war will break out.

Incorrect submission (verdict: Wrong Answer):
x = list(map(int, input().split()))
n = [list(map(int, input().split())) for i in range(2)]
a = sorted(n[0], reverse=True)[0]
b = sorted(n[1])[0]
print(a)
print(b)
war = 0
for i in range(x[2]+1, x[3]):
  if (i > a) and (i <= b):
    war = 1
if war == 1:
  print('No War')
else:
  print('War')


Fixed, accepted submission:
x = list(map(int, input().split()))
n = [list(map(int, input().split())) for i in range(2)]
a = sorted(n[0], reverse=True)[0]
b = sorted(n[1])[0]
war = 0
for i in range(x[2]+1, x[3]):
  if (i > a) and (i <= b):
    war = 1
if war == 1:
  print('No War')
else:
  print('War')
Problem:
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.

Incorrect submission (verdict: Wrong Answer):
#-*-coding:utf-8-*-

def main():
    a,b,x = map(int,input().split())

    if b-x>0 and a<x:
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

Fixed, accepted submission:
#-*-coding:utf-8-*-

def main():
    a,b,x = map(int,input().split())

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

if __name__=="__main__":
    main()