Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())

flag = True
for i in range(10**18):
    if k == 0:
        break
    if a == b and b == c:
        break
    A = a
    B = b
    C = c
    a = B + C
    b = A + C
    c = A + B
    if i == k - 1:
        break
    if a - b > 10**18 or a-b < -10**18:
        flag = False
        break
if flag:
    print(a - b)
else:
    print('Unfair')


Fixed submission:
a, b, c, k = map(int, input().split())
x = a - b
if x > 10**18:
    print('Unfair')
elif k % 2 == 0:
    print(x)
else:
    print(-x)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())

flag = True
for i in range(10**18):
    if k == 0:
        break
    if a == b and b == c:
        break
    A = a
    B = b
    C = c
    a = B + C
    b = A + C
    c = A + B
    if i == k - 1:
        break
    if abs(a - b) > 10**9:
        flag = False
        break
if flag:
    print(a - b)
else:
    print('Unfair')


Fixed submission:
a, b, c, k = map(int, input().split())
x = a - b
if x > 10**18:
    print('Unfair')
elif k % 2 == 0:
    print(x)
else:
    print(-x)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())

flag = True
for i in range(10**18):
    if k == 0:
        break
    if a == b and b == c:
        break
    A = a
    B = b
    C = c
    a = B + C
    b = A + C
    c = A + B
    if i == k - 1:
        break
    if abs(a - b) > 10**18:
        flag = False
        break
if flag:
    print(a - b)
else:
    print('Unfair')


Fixed submission:
a, b, c, k = map(int, input().split())
x = a - b
if x > 10**18:
    print('Unfair')
elif k % 2 == 0:
    print(x)
else:
    print(-x)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())

for i in range(10**18):
    if k == 0:
        break
    if a == b and b == c:
        break
    A = a
    B = b
    C = c
    a = B + C
    b = A + C
    c = A + B
    if i == k - 1:
        break
if abs(a - b) <= 10**18:
    print(a - b)
else:
    print('Unfair')


Fixed submission:
a, b, c, k = map(int, input().split())
x = a - b
if x > 10**18:
    print('Unfair')
elif k % 2 == 0:
    print(x)
else:
    print(-x)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())

for i in range(10**18):
    A = a
    B = b
    C = c
    a = B + C
    b = A + C
    c = A + B
    if i == k - 1:
        break
if abs(a - b) <= 10**18:
    print(a - b)
else:
    print('Unfair')


Fixed submission:
a, b, c, k = map(int, input().split())
x = a - b
if x > 10**18:
    print('Unfair')
elif k % 2 == 0:
    print(x)
else:
    print(-x)

Buggy python submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())

for i in range(10**18):
    A = a
    B = b
    C = c
    a = B + C
    b = A + C
    c = A + B
    if i = k - 1:
        break
if abs(a - b) <= 10**18:
    print(a - b)
else:
    print('Unfair')

Fixed submission:
a, b, c, k = map(int, input().split())
x = a - b
if x > 10**18:
    print('Unfair')
elif k % 2 == 0:
    print(x)
else:
    print(-x)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
l = [i for i in range(a, b + 1)]
s = sorted(l)
if len(s) > k * 2:
    s = s[:k] + s[-k:]
for i in s:
    print(i)

Fixed submission:
a, b, k = map(int, input().split())
n = b - a + 1
if n <= k * 2:
    for i in range(a, b + 1):
        print(i)
else:
    for i in range(a, a + k):
        print(i)
    for j in range(b - k + 1, b + 1):
        print(j)

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input())
l = [i for i in range(a, b + 1)]
s = sorted(l)
if len(s) > k * 2:
    s = s[:k + 1] + s[k:]
print(s)

Fixed submission:
a, b, k = map(int, input().split())
n = b - a + 1
if n <= k * 2:
    for i in range(a, b + 1):
        print(i)
else:
    for i in range(a, a + k):
        print(i)
    for j in range(b - k + 1, b + 1):
        print(j)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

count = 0
for i in range(a, b + 1):
    l = list(i)
    up = l[:(len(l) // 2) - 1]
    if len(l) % 2 == 0:
        dowm = reverse(l[len(l) // 2:])
    else:
        dowm = reverse(l[(len(l) // 2) + 1:])
    if up == down:
        count += 1
print(count)

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

count = 0
for i in range(a, b + 1):
    l = list(str(i))
    up = l[:(len(l) // 2)]
    if len(l) % 2 == 0:
        down = l[len(l) // 2:]
        down.reverse()
    else:
        down = l[(len(l) // 2) + 1:]
        down.reverse()
    if up == down:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = list(input())

flag1 = False
if s[a] == '-':
    flag1 = True

flag2 = False
if not '-' in s[:a - 1] and '-' in s[a + 1:]
    flag2 = True
  
if flag1 and flag2:
    print('Yes')
else:
    print('No')

Fixed submission:
a, b = map(int, input().split())
s = list(input())

flag1 = False
if s[a] == '-':
    flag1 = True

flag2 = False
if not '-' in s[:a - 1] and not '-' in s[a + 1:]:
    flag2 = True

if flag1 and flag2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))

a1 = sorted(a)
a2 = []
count = 0
for i in range(n - 1):
    if a1[i] == a1[i + 1]:
        count += 1
    else:
        a2.append(count)
        break
a2.append(count)
l = sorted(a2)
print(sun(l[:len(l) - k - 1]))

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

a1 = sorted(a)
a2 = []
count = 1
for i in range(n - 1):
    if a1[i] == a1[i + 1]:
        count += 1
    else:
        a2.append(count)
        count = 1
a2.append(count)
l = sorted(a2)
print(sum(l[:len(l) - k]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
count = 0
for i in range(n):
    a = int(input())
    if a in l:
        l.remove(a)
        count -= 1
    else:
        l.append(a)
        count += 1
print(count)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]

l = sorted(a)
same = 1
count = 0
for i in range(1, n):
    if l[i] == l[i - 1]:
        same += 1
        continue
    if same % 2 == 1:
        count += 1
    same = 1
if same % 2 == 1:
    count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]

l = []
count = 0
for i in range(n):
    if a[i] in l:
        l.remove(a[i])
        count -= 1
    else:
        l.append(a[i])
        count += 1
print(count)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]

l = sorted(a)
same = 1
count = 0
for i in range(1, n):
    if l[i] == l[i - 1]:
        same += 1
        continue
    if same % 2 == 1:
        count += 1
    same = 1
if same % 2 == 1:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
s = input()

l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h, 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in l:
    if not i in s:
        print(i)
        break


Fixed submission:
s = input()

l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
flag = True
for i in l:
    if not i in s:
        print(i)
        flag = False
        break
if flag:
    print('None')

Buggy python submission (verdict: Runtime Error):
s = input()

l = [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]
for i in l:
    if not i in s:
        print(i)
        break

Fixed submission:
s = input()

l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
flag = True
for i in l:
    if not i in s:
        print(i)
        flag = False
        break
if flag:
    print('None')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]

l = [1]
bot = 1
for i in range(n):
    bot = a[bot - 1]
    if bot == 2:
        print(i + 1)
        break
    if bot in l:
        print(-1)
        break
    else:
        l.append(bot)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]

l = [1]
bot = 1
flag = True
for i in range(n):
    bot = a[bot - 1]
    if bot == 2:
        print(i + 1)
        flag = False
        break

if flag:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

import math
if n == m:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon * 2
elif n == m + 1 or n == m - 1:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon
else:
    ans = 0

print(ans　// (10 ** 9 + 7))

Fixed submission:
n, m = map(int, input().split())

import math
if n == m:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon * 2
elif n == m + 1 or n == m - 1:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon
else:
    ans = 0

print(ans % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
count = [0] * n
for i in range(m):
    a = list(map(int, input().split()))
    for j in range(j):
        if j + 1 in a:
            count[j] += 1
for i in range(i):
    print(count[i])

Fixed submission:
n, m = map(int, input().split())
count = [0] * n
for i in range(m):
    a = list(map(int, input().split()))
    for j in range(n):
        if j + 1 in a:
            count[j] += 1
for i in range(n):
    print(count[i])
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a > b:
    print('GREATER')
elif b > a:
    print('LESS')
else:
    print('EQUAL')

Fixed submission:
a = int(input())
b = int(input())

if a > b:
    print('GREATER')
elif b > a:
    print('LESS')
else:
    print('EQUAL')

Buggy python submission (verdict: Runtime Error):
a, b = input().split()

a = list(a)
b = list(b)

a = [int(a[i]) for i in range(len(a))]
b = [int(b[i]) for i in range(len(b))]

flag = True
if len(a) > len(b):
    print('GREATER')
    flag = False
elif len(b) > len(a):
    print('LESS')
    flag = False
else:
    for i in range(len(a)):
        if a[i] > b[i]:
            print('GREATER')
            flag = False
            break
        elif b[i] > a[i]:
            print('LESS')
            flag = False
            break
if flag:
    print('EQUAL')

Fixed submission:
a = int(input())
b = int(input())

if a > b:
    print('GREATER')
elif b > a:
    print('LESS')
else:
    print('EQUAL')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

a = list(a)
b = list(b)

flag = True
if len(a) > len(b):
    print('GREATER')
    flag = False
elif len(b) > len(a):
    print('LESS')
    flag = False
else:
    for i in range(len(a)):
        if a[i] > b[i]:
            print('GREATER')
            flag = False
            break
        elif b[i] > a[i]:
            print('LESS')
            flag = False
            break
if flag:
    print('EQUAL')

Fixed submission:
a = int(input())
b = int(input())

if a > b:
    print('GREATER')
elif b > a:
    print('LESS')
else:
    print('EQUAL')
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
s = input()

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count <= a + b:
            print('yes')
            count += 1
        else:
            print('no')
    if i == 'b':
        if count <= a + b and count_b <= b
            print('yes')
            count += 1
            count_b += 1
        else:
            print('no')
    else:
        print('no')

Fixed submission:
n, a, b = map(int, input().split())
s = input()

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count < a + b:
            print('Yes')
            count += 1
        else:
            print('No')
    elif i == 'b':
        if (count < a + b) and (count_b < b):
            print('Yes')
            count += 1
            count_b += 1
        else:
            print('No')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
import numpy as np
h,w,k=map(int, input().split())
c=[list(input().split())  for i in  range(h)]
print(c)

Fixed submission:
n=int(input())

x=n//1000
if n%1000==0:
  print(0)
else:
  print(1000-(n-1000*x))
Buggy python submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
a = list(input().split())
a = [int(i) for i in a]
b = list(input().split())
b = [int(i) for i in b]
aa=a.copy()
aa.extend(b)
if sum(aa)<=k:
  print(n+m)
  exit()

#print(aa)
ai,bi=0,0
ans=0
for _ in range(n+m):
  #print(k, a[ai], b[bi], ai,bi)
  if k<= a[ai] and k<= b[bi]:
    print(ans)
    exit()
    
  if a[ai] <= b[bi]:
    k-=a[ai]
    ai+=1
    ans+=1
  else:
    k-=b[bi]
    bi+=1
    ans+=1
    
  if ai == len(a):
    a=[10*10]*10000
  if bi == len(b):
    b=[10*10]*10000
    
print(ans)

Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    #print(b[j],K - a[i])
    j -= 1
  ans = max(ans, i + j)
  #print("ans",ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
a = list(input().split())
a = [int(i) for i in a]
b = list(input().split())
b = [int(i) for i in b]
aa=a.copy()
aa.extend(b)
if sum(aa)<=k:
  print(n+m)
  exit()

#print(aa)
ai,bi=0,0
ans=0
for _ in range(n+m):
  #print(k, a[ai], b[bi], ai,bi)
  if k<= a[ai] and k<= b[bi]:
    print(ans)
    exit()
    
  if a[ai] <= b[bi]:
    k-=a[ai]
    ai+=1
    ans+=1
  else:
    k-=b[bi]
    bi+=1
    ans+=1
    
  if ai == len(a):
    a=[10*9]*10000
  if bi == len(b):
    b=[10*9]*10000
    
print(ans)

Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    #print(b[j],K - a[i])
    j -= 1
  ans = max(ans, i + j)
  #print("ans",ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
a = list(input().split())
a = [int(i) for i in a]
b = list(input().split())
b = [int(i) for i in b]
aa=a.copy()
aa.extend(b)
if sum(aa)<=k:
  print(n+m)
  exit()

#print(aa)
ai,bi=0,0
ans=0
for _ in range(n+m):
  #print(k, a[ai], b[bi])
  if k<= a[ai] and k<= b[bi]:
    print(ans)
    exit()
    
  if a[ai] <= b[bi]:
    k-=a[ai]
    ai+=1
    ans+=1
  else:
    k-=b[bi]
    bi+=1
    ans+=1
print(ans)

Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    #print(b[j],K - a[i])
    j -= 1
  ans = max(ans, i + j)
  #print("ans",ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())

a = list(input().split())
a = [int(i) for i in a]
ans=1

if len(a) % 2 == 1: 
  for i in range(1, int(len(a)/2)+2):
    if ans > 10**18 or ans == 0:
      break
    if a[i-1] == 1:
      continue
    if i == int(len(a)/i) + 1:
      ans = ans*a[i-1]
    else:
      ans = ans*a[i-1]*a[-1*i]
    
else:
  for i in range(0, int(len(a)/2)):
    if ans > 10**18 or ans == 0:
      break
    if a[i-1] == 1:
      continue
    ans = ans*a[i]*a[-1 - i]
    

if ans > 10**18:
  print('-1')
else:
  print(ans)


Fixed submission:
a, b = [int(i)  for i in input().split()]

print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

a = list(input().split())
a = [int(i) for i in a]
ans=1

if len(a) % 2 == 1: 
  for i in range(1, int(len(a)/2)+2):
    if i == int(len(a)/i) + 1:
      ans = ans*a[i-1]
    else:
      ans = ans*a[i-1]*a[-1*i]
else:
  for i in range(0, int(len(a)/2)):
    ans = ans*a[i]*a[-1 - i]

if ans > 10**18:
  print('-1')
else:
  print(ans)

Fixed submission:
n=int(input())

a = list(input().split())
a = [int(i) for i in a]
ans=1


if 0 in a:
  pass

elif len(a) % 2 == 1: 
  for i in range(1, int(len(a)/2)+2):
    #print(ans)
    if ans > 10**18 or ans == 0:
      break
    if i == int(len(a)/2) + 1:
      ans = ans*a[i-1]
    else:
      ans = ans*a[i-1]*a[-1*i]
    
else:
  for i in range(0, int(len(a)/2)):
    if ans > 10**18 or ans == 0:
      break
    ans = ans*a[i]*a[-1 - i]
    

if ans > 10**18:
  print('-1')
elif 0 in a:
  print(0)
else:
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

a = list(input().split())
a = [int(i) for i in a]
ans=1
for i in a:
  ans = ans*i

if ans > 10**18:
  print('-1')
else:
  print(ans)

Fixed submission:
n=int(input())

a = list(input().split())
a = [int(i) for i in a]
ans=1


if 0 in a:
  pass

elif len(a) % 2 == 1: 
  for i in range(1, int(len(a)/2)+2):
    #print(ans)
    if ans > 10**18 or ans == 0:
      break
    if i == int(len(a)/2) + 1:
      ans = ans*a[i-1]
    else:
      ans = ans*a[i-1]*a[-1*i]
    
else:
  for i in range(0, int(len(a)/2)):
    if ans > 10**18 or ans == 0:
      break
    ans = ans*a[i]*a[-1 - i]
    

if ans > 10**18:
  print('-1')
elif 0 in a:
  print(0)
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,k=map(int, input().split())
p=list(map(int,input().split()))


s=[]
p=np.array(p)
sum=0
for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
  
max=s[k]-s[0]
for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
  
print(max)

Fixed submission:
import numpy as np
n,k=map(int, input().split())
p=list(map(int,input().split()))


s=[]
p=np.array(p)
sum=0
for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
#print(s)
if k==n:
  print(s[-1])
  exit()
max=s[k-1]-s[0]
for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
  
print(max)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int, input().split())
p=list(map(int,input().split()))


l=[]
for i in range(n):
  l.append(sum(p[i:i+k]))

ans=0.0
max=l.index(max(l))
ans=sum(list(range(1,p[max]+1)))/p[max]
x=sum(list(range(1,p[max]+1)))/p[max]
p0=p[max]
for i in range(max+1,max+k):
  g=p[i]-p[max]
  #print(p[max],p[i])
  ans+=x+(g*0.5)
  
print(ans)


Fixed submission:
import numpy as np
n,k=map(int, input().split())
p=list(map(int,input().split()))


s=[]
p=np.array(p)
sum=0
for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
#print(s)
if k==n:
  print(s[-1])
  exit()
max=s[k-1]-s[0]
for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
  
print(max)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int, input().split())
p=list(map(int,input().split()))


l=[]
for i in range(n):
  l.append(sum(p[i:i+k]))

ans=0.0
max=l.index(max(l))
for i in range(k):
  ans+=sum(list(range(1,p[max+i]+1)))/p[max+i]
  
print(ans)


Fixed submission:
import numpy as np
n,k=map(int, input().split())
p=list(map(int,input().split()))


s=[]
p=np.array(p)
sum=0
for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
#print(s)
if k==n:
  print(s[-1])
  exit()
max=s[k-1]-s[0]
for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
  
print(max)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int, input().split())
p=list(map(int,input().split()))

max=p[0:k]
for i in range(n):
  if sum(p[i:i+k]) >= sum(max):
    max=p[i:i+k]

ans=0.0
#print(max,k)
for i in max:
  x=float(1/i)
  for j in range(1,i+1):
    ans+=float(j*x)
print(ans)

Fixed submission:
import numpy as np
n,k=map(int, input().split())
p=list(map(int,input().split()))


s=[]
p=np.array(p)
sum=0
for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
#print(s)
if k==n:
  print(s[-1])
  exit()
max=s[k-1]-s[0]
for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
  
print(max)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
import numpy as np
n=int(input())
xl=[list(map(int,input().split()))  for i in  range(n)]

cp=copy.deepcopy(xl)
cp=np.array(cp)
cp=cp.T
#xSort = np.sort(cp[0])[::-1]
dict={k: v for v, k in enumerate(cp[0])}
xr=[x+cp[1][dict[x]] for x in cp[0]]
xl=[x-cp[1][dict[x]] for x in cp[0]]
#print(xr)
#print(xl)
xlc=copy.deepcopy(xl)
xl.sort(reverse=True)
xrs=[xr[xlc.index(x)] for x in xl]
#print("xrs", xrs)
#print("xls", xls)

ans=0
r=10**5+1
for i in range(len(xl)):
  if xrs[i]>r:
    continue
  if xl[i]<=r:
    r=xl[i]
    #print("r",r)
    ans+=1
    
print(ans)

Fixed submission:
import copy
import numpy as np
n=int(input())
xl=[]
for i in range(n):
    x,l = map(int,input().split())
    xl.append([x-l,l+x])
#print(xl)
xl = sorted(xl, key=lambda x: x[0],reverse=True)
#print(xl)

ans=0
r=2*(10**9+1)
for i in range(n):
  if xl[i][1]>r:
    continue
  if xl[i][0]<=r:
    r=xl[i][0]
    #print("r",r)
    ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import numpy as np
n=int(input())
xl=[list(map(int,input().split()))  for i in  range(n)]

cp=copy.deepcopy(xl)
cp=np.array(cp)
cp=cp.T
#xSort = np.sort(cp[0])[::-1]
dict={k: v for v, k in enumerate(cp[0])}
xr=[x+cp[1][dict[x]] for x in cp[0]]
xl=[x-cp[1][dict[x]] for x in cp[0]]
#print(xr)
#print(xl)
xls=sorted(xl, reverse=True)
xrs=[xr[xl.index(x)] for x in xls]
#print("xrs", xrs)
#print("xls", xls)

ans=0
r=10**5+1
for i in range(len(xls)):
  if xrs[i]>r:
    continue
  if xls[i]<=r:
    r=xls[i]
    #print("r",r)
    ans+=1
    
print(ans)

Fixed submission:
import copy
import numpy as np
n=int(input())
xl=[]
for i in range(n):
    x,l = map(int,input().split())
    xl.append([x-l,l+x])
#print(xl)
xl = sorted(xl, key=lambda x: x[0],reverse=True)
#print(xl)

ans=0
r=2*(10**9+1)
for i in range(n):
  if xl[i][1]>r:
    continue
  if xl[i][0]<=r:
    r=xl[i][0]
    #print("r",r)
    ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import numpy as np
n=int(input())
xl=[list(map(int,input().split()))  for i in  range(n)]

cp=copy.deepcopy(xl)
cp=np.array(cp)
cp=cp.T
xSort = np.sort(cp[0])[::-1]
dict={k: v for v, k in enumerate(cp[0])}

xr=[x+cp[1][dict[x]] for x in xSort]
xl=[x-cp[1][dict[x]] for x in xSort]
#print(xr)
#print(xl)
xls=sorted(xl, reverse=True)
xrs=[xr[xl.index(x)] for x in xls]
#print("xrs", xrs)
#print("xls", xls)

ans=0
r=10**5+1
for i in range(len(xls)):
  if xrs[i]>r:
    continue
  if xls[i]<=r:
    r=xls[i]
    #print("r",r)
    ans+=1
    
print(ans)

Fixed submission:
import copy
import numpy as np
n=int(input())
xl=[]
for i in range(n):
    x,l = map(int,input().split())
    xl.append([x-l,l+x])
#print(xl)
xl = sorted(xl, key=lambda x: x[0],reverse=True)
#print(xl)

ans=0
r=2*(10**9+1)
for i in range(n):
  if xl[i][1]>r:
    continue
  if xl[i][0]<=r:
    r=xl[i][0]
    #print("r",r)
    ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q=map(int, input().split())

a = [int(input()) for i in range(q)]

for i in range(1,n+1):
  if k - (len(a)-a.count(i)) > 0:
    print("Yes")
  else:
    print("No")

Fixed submission:
from collections import Counter as C
n,k,q=map(int, input().split())

a = [int(input()) for i in range(q)]
#ans=["Yes"]*n
d=C(a)
len=len(a)
for i in range(1,n+1):
  try:
    if k - (len-d[i]) > 0:
      print("Yes")
    else:
      print("No")
  except:
    if k-len(a)>0:
      print("Yes")
    else:
      print("No")