Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

cnt = 0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i + j + k == S:
                cnt += 1

print(cnt)


Fixed submission:
K, S = map(int, input().split())

cnt = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S - (i + j) <= K:
            cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
INF=1000000000+7

s=int(input())
dp=[0]*(s+1);
dp[0]=dp[1]=dp[2]=0
dp[3]=1
for i in range(4,s+1):
	temp=1
	for j in range(3,i-2):
		temp+=dp[j]%INF;
	temp%=INF;
	dp[i]=temp
print(dp[s])


Fixed submission:
INF=1000000000+7

s=int(input())
dp=[0]*(2000+1);
	
dp[0]=dp[1]=dp[2]=0
dp[3]=1


for i in range(4,s+1):
	temp=1
	for j in range(3,i-2):
		temp+=dp[j]%INF;
	temp%=INF;
	dp[i]=temp
print(dp[s])
Buggy python submission (verdict: Runtime Error):
n=int(input())
arr=list(map(int,input().split()))
ans=0
for i in range(1,n):
	if(arr[i]<arr[i-1]):
		ans+=arr[i-1]-arr[i]
		arr[i]+=arr[i-1]-arr[i]
		
print(ans)
	


Fixed submission:
n,x,t=map(int,input().split())
ans=0;
while(n>0):
	ans+=t;
	n-=x;
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
li = list(map(int,input().split()))
asum = 0
newli = list(itertools.combinations(li,2))
for i in range(n*(n-1)//2):
    asum += newli[i][0]*newli[i][1]
    if asum >= 10**9 + 7:
        asum = asum % (10**9 + 7)
print(asum)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
licumsum = 0
for i in range(n):
    licumsum += li[i]
asum = 0
for i in range(n):
    asum += li[i]*(licumsum - li[i])
    if asum >= (10**9 + 7)*2:
        asum = asum % ((10**9 + 7)*2)
if asum//2 >= 10**9 + 7:
    print(asum//2-(10**9+7))
else:
    print(asum//2)
Buggy python submission (verdict: Runtime Error):
h,w,m = map(int,input().split())
hli = [0]*h
wli = [0]*w
li = []
for i in range(m):
    a,b = map(int,input().split())
    li.append([a,b])
    hli[a-1] += 1
    wli[b-1] += 1
a = max(hli)
b = max(wli)
hli2 = []
wli2 = []
for i in range(h):
    if hli[i] == a:
        hli2.append(i+1)
for i in range(w):
    if wli[i] == b:
        wli2.append(i+1)
for i in hli2:
    for j in wli2:
        if [i,j] not in li:
            print(a + b)
            exit()
print(a + b - 1)

Fixed submission:
n,x,t = map(int,input().split())
if n % x == 0:
    print(n//x*t)
else:
    print((n//x+1)*t)
Buggy python submission (verdict: Time Limit Exceeded):
def divisor(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
a = 0
n = int(input())
for i in range(1,n+1):
    a += i*(len(divisor(i)))
print(a)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n+1):
    a = n//i
    ans += i*(a*(a+1)//2)
print(ans)

Buggy python submission (verdict: Runtime Error):
import sympy
a = 0
n = int(input())
for i in range(1,n+1):
    a += i*(sympy.divisor_count(i))
print(a)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n+1):
    a = n//i
    ans += i*(a*(a+1)//2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def divisors(n):
    d=[]
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            d.append(i)
            if i!=n//i:
                d.append(n//i)
    d.sort()
    return d

a = 0
n = int(input())
for i in range(1,n+1):
    a += i*len(divisors(i))
print(a)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n+1):
    a = n//i
    ans += i*(a*(a+1)//2)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
c = 0
n1 = 0
n1 += n
for i in range(1,12):
    a = n1 - 26**(i)
    c += 1
    if a <= 0:
        break
    n1 = n1 - 26**(i)
a = ""
for i in range(c):
    if n // 26**(c-i-1) >= 26:
        alpha = 26
        n = n - 26**(c-i)
    else:
        alpha = n // 26**(c-i-1)
        n = n % 26**(c-i-1)
    a += chr(96 + alpha)
print(a)

Fixed submission:
a = input()
if str.upper(a) == a:
    print("A")
else:
    print("a")
Buggy python submission (verdict: Runtime Error):
a,b = input().split()
a1 = int(a)
b1 = int(b*100)
print((a1*b1)//100)

Fixed submission:
a,b = input().split()
a1 = int(a)
b1 = int(b[0] + b[2] + b[3])
print(a1*b1//100)
Buggy python submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
li1 = []
li2 = []
for i in range(n):
    li1.append(list(map(int,input().split())))
for i in range(2**n):
    b = '0'*(n-len(bin(i))+2)+bin(i)[2:]
    total = 0
    li3 = [0]*m
    f = 1
    for j in range(n):
        if b[j] == "1":
            total += li1[j][0]
            for k in range(m):
                li3[k] += li1[j][k+1]
    for j in range(m):
        if li3[j] < x:
            f = 0
    if f == 1:
        li2.append(total)
print(min(li2))


Fixed submission:
n,m,x = map(int,input().split())
li1 = []
li2 = []
for i in range(n):
    li1.append(list(map(int,input().split())))
for i in range(2**n):
    b = '0'*(n-len(bin(i))+2)+bin(i)[2:]
    total = 0
    li3 = [0]*m
    f = 1
    for j in range(n):
        if b[j] == "1":
            total += li1[j][0]
            for k in range(m):
                li3[k] += li1[j][k+1]
    for j in range(m):
        if li3[j] < x:
            f = 0
    if f == 1:
        li2.append(total)
if len(li2) >= 1:
    print(min(li2))
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
for i in range(1,max(li)+1):
    print(li.count(i))
for i in range(n-max(li)):
    print("0")


Fixed submission:
n = int(input())
li = [0]*n
li1 = list(map(int,input().split()))
for i in range(n-1):
    li[li1[i]-1] += 1
for i in range(n):
    print(li[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
for i in range(1,n):
    print(li.count(i))
print(0)

Fixed submission:
n = int(input())
li = [0]*n
li1 = list(map(int,input().split()))
for i in range(n-1):
    li[li1[i]-1] += 1
for i in range(n):
    print(li[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
lians = []
for i in range(1,n):
    lians.append(li.count(i))
lians.append(0)
for i in range(n):
    print(lians[i])

Fixed submission:
n = int(input())
li = [0]*n
li1 = list(map(int,input().split()))
for i in range(n-1):
    li[li1[i]-1] += 1
for i in range(n):
    print(li[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
lians = []
for i in range(1,n):
    lians.append(li.count(i))
lians.append(0)
for i in range(n):
    print(lians[i])

Fixed submission:
n = int(input())
li = [0]*n
li1 = list(map(int,input().split()))
for i in range(n-1):
    li[li1[i]-1] += 1
for i in range(n):
    print(li[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
lians = []
for i in range(1,n):
    lians.append(li.count(i))
lians.append(0)
for i in range(n):
    print(lians[i])

Fixed submission:
n = int(input())
li = [0]*n
li1 = list(map(int,input().split()))
for i in range(n-1):
    li[li1[i]-1] += 1
for i in range(n):
    print(li[i])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = s.count("R") * s.count("G") * s.count("B")
for i in range(n):
    for j in range(n):
        if i+2*j < n:
            if (s[i],s[i+j],s[i+2*j]) == ("R","G","B") or (s[i],s[i+j],s[i+2*j]) == ("R","B","G")or (s[i],s[i+j],s[i+2*j]) == ("G","B","R") or (s[i],s[i+j],s[i+2*j]) == ("G","R","B") or (s[i],s[i+j],s[i+2*j]) == ("B","G","R") or (s[i],s[i+j],s[i+2*j]) == ("B","R","G"):
                ans -= 1
print(ans)

Fixed submission:
n = int(input())
s = input()
ans = s.count("R") * s.count("G") * s.count("B")
for i in range(n):
    for j in range(n):
        if i+2*j < n:
            if (s[i],s[i+j],s[i+2*j]) == ("R","G","B") or (s[i],s[i+j],s[i+2*j]) == ("R","B","G")or (s[i],s[i+j],s[i+2*j]) == ("G","B","R") or (s[i],s[i+j],s[i+2*j]) == ("G","R","B") or (s[i],s[i+j],s[i+2*j]) == ("B","G","R") or (s[i],s[i+j],s[i+2*j]) == ("B","R","G"):
                ans -= 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
lia = [0]*n
lib = [0]*n
for i in range(n):
    lia[li[i]-1] += 1
for i in range(n):
    if lia[i] >= 2:
        lia[i] -= 1
        lib[i] += (lia[i]*(lia[i]+1)//2)
for i in range(n):
    a = lib[li[i]-1]
    lib[li[i]-1] = (lia[li[i]-1]-1)*(lia[li[i]-1])//2
    print(sum(lib))
    lib[li[i]-1] = a

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
lia = [0]*n
sum1 = 0
for i in range(n):
    lia[li[i]-1] += 1
for i in range(n):
    if lia[i] >= 2:
        lia[i] -= 1
        sum1 += (lia[i]*(lia[i]+1)//2)
    else:
        if lia[i] == 1:
            lia[i] -= 1
for i in range(n):
    if lia[li[i]-1] >= 1:
        a = lia[li[i]-1]*(lia[li[i]-1]+1)//2
        b = (lia[li[i]-1]-1)*lia[li[i]-1]//2
        print(sum1-a+b)
    else:
        print(sum1)
Buggy python submission (verdict: Runtime Error):
a = list(input().count("A"))
if a == 3:
  print("No")
elif a == 0:
  print("No")
else:
  print("Yes")

Fixed submission:
a = input().count("A")
if a == 3:
  print("No")
elif a == 0:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
a = list(input().count("A"))
if a = 3:
  print("No")
elif a = 0:
  print("No")
else:
  print("Yes")

Fixed submission:
a = input().count("A")
if a == 3:
  print("No")
elif a == 0:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
ans = a*(n//(a+b)) + min(N%(a+b),a)
print(ans)

Fixed submission:
n,a,b = map(int,input().split())
ans = a*(n//(a+b)) + min(n%(a+b),a)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
count = 0
for i in range(n):
    if li.count(li[i]) >= 2:
        print("NO")
        break
    else:
        count += 1
if count == n:
    print("YES")

Fixed submission:
n = int(input())
s = set(list(map(int,input().split())))

if n==len(s):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
li = list(map(int,input().split()))
li.sort(reverse=True)
for i in range(k):
    li.remove(li[0])
print(sum(li))

Fixed submission:
n,k = map(int,input().split())
li = list(map(int,input().split()))
lenght = len(li)
li.sort(reverse=True)
if lenght <= k:
    del li[0:lenght]
else:
    del li[0:k]
print(sum(li))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
li = [[0,0] for _ in range(n)]
t1,t2 = 0,0
for i in range(m):
    a,b = input().split()
    if li[int(a)-1][0] != 1:
        if b == "WA":
            li[int(a)-1][1] += 1
        else b == "AC":
            li[int(a)-1][0] += 1
for i in range(n):
    t1 += li[i][0]
    t2 += li[i][1]
print(t1,t2)

Fixed submission:
n,m = map(int,input().split())
li = [[0,0] for _ in range(n)]
t1,t2 = 0,0
for i in range(m):
    a,b = input().split()
    if li[int(a)-1][0] != 1:
        if b == "WA":
            li[int(a)-1][1] += 1
        if b == "AC":
            li[int(a)-1][0] += 1
for i in range(n):
    t1 += li[i][0]
    t2 += li[i][1]*li[i][0]
print(t1,t2)
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print(a*b//(math.gcd(a,b))) 

Fixed submission:
import fractions
a,b = map(int,input().split())
print(a*b//(fractions.gcd(a,b)))

Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print((a*b)//math.gcd(a,b))

Fixed submission:
import fractions
a,b = map(int,input().split())
print(a*b//(fractions.gcd(a,b)))

Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print(a * b / (math.gcd(a,b)))

Fixed submission:
import fractions
a,b = map(int,input().split())
print(a*b//(fractions.gcd(a,b)))

Buggy python submission (verdict: Runtime Error):
from math import gcd
a,b = map(int,input().split())
print(a * b / (gcd(a,b)))

Fixed submission:
import fractions
a,b = map(int,input().split())
print(a*b//(fractions.gcd(a,b)))

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
from math import gcd
print(a * b / (gcd(a,b)))

Fixed submission:
import fractions
a,b = map(int,input().split())
print(a*b//(fractions.gcd(a,b)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
count = 0
lia = []
lib = list(map(int,input().split()))
for i in range(1,n+1):
    lia.append(i)
for i in range(n):
    if lia[i] != lib[i]:
        count += 1
    if count > 3:
        print("NO")
        break
if count <= 2:
    print("YES")

Fixed submission:
n,k = map(int,input().split())
li = list(map(int,input().split()))
count = 0
for i in range(n):
    if li[i] >= k:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
for i in range(1,n+1):
    print(a.index(str(i))+1, end=" ")


Fixed submission:
n = int(input())
lia = [int(s) for s in input().split()]
lib = [0]*n
for i in range(n):
    lib[lia[i] - 1] += i + 1
lic = [str(s) for s in lib]
print(" ".join(lic))
Buggy python submission (verdict: Runtime Error):
print((int.input())**3)

Fixed submission:
print((int(input()))**3)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
total = 0
for i in range(n-1):
    total += i+1
print(total)

Fixed submission:
n = int(input())
total = 0
print(n*(n-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = []
count = 0
f = 1
for i in range(n):
    a = input()
    li.append("".join(sorted(a)))
li.sort()
for i in range(n-1):
    if li[0] == li[1]:
        f += 1
        del li[0]
    else:
        count += (f*(f-1))//2
        f = 1
        del li[0]
count += (f*(f-1))//2
print(count)

Fixed submission:
n = int(input())
li = []
count = 0
f = 1
for i in range(n):
    a = input()
    li.append("".join(sorted(a)))
li.sort()
for i in range(n-1):
    if li[i] == li[i+1]:
        f += 1
    else:
        count += (f*(f-1))//2
        f = 1
count += (f*(f-1))//2
print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
li = []
li.append(0)
count = 0
f = 1
for i in range(n):
    a = input()
    li.append("".join(sorted(a)))
li.sort()
for i in range(n-1):
    if li[0] == li[1]:
        f += 1
        del li[0]
    else:
        count += (f*(f-1))//2
        f = 1
        del li[0]
print(count)

Fixed submission:
n = int(input())
li = []
count = 0
f = 1
for i in range(n):
    a = input()
    li.append("".join(sorted(a)))
li.sort()
for i in range(n-1):
    if li[i] == li[i+1]:
        f += 1
    else:
        count += (f*(f-1))//2
        f = 1
count += (f*(f-1))//2
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
li = []
lic = []
count = 0
for i in range(n):
    lic.append(i+1)
    lia = list(input())
    lia.sort()
    li.append(lia)
lib = list(itertools.combinations(lic,2))
for i in range(len(lib)):
    if li[lib[i][0]-1] == li[lib[i][1]-1]:
        count += 1
print(count)

Fixed submission:
n = int(input())
li = []
count = 0
f = 1
for i in range(n):
    a = input()
    li.append("".join(sorted(a)))
li.sort()
for i in range(n-1):
    if li[i] == li[i+1]:
        f += 1
    else:
        count += (f*(f-1))//2
        f = 1
count += (f*(f-1))//2
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
li = []
lic = []
count = 0
for i in range(n):
    lic.append(i+1)
for i in range(n):
    lia = list(input())
    lia.sort()
    li.append(lia)
lib = list(itertools.combinations(lic,2))
for i in range(len(lib)):
    if li[lib[i][0]-1] == li[lib[i][1]-1]:
        count += 1
print(count)

Fixed submission:
n = int(input())
li = []
count = 0
f = 1
for i in range(n):
    a = input()
    li.append("".join(sorted(a)))
li.sort()
for i in range(n-1):
    if li[i] == li[i+1]:
        f += 1
    else:
        count += (f*(f-1))//2
        f = 1
count += (f*(f-1))//2
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
li1 = list(map(int,inpout().split()))
li2 = []
count = 0
for i in range(n):
    li2.append(i+1)
for i in range(n):
    if li1[i] != li2[i]:
        count += 1
if count == 0 or count == 2:
    print("YES")
else:
    print("NO")

Fixed submission:
n = int(input())
li1 = list(map(int,input().split()))
li2 = []
count = 0
for i in range(n):
    li2.append(i+1)
for i in range(n):
    if li1[i] != li2[i]:
        count += 1
if count == 0 or count == 2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = []
for i in range(n):
    li.append(int(input()))
for i in range(n):
    k = li[i]
    li[i] = 0
    print(max(li))
    li[i] = k

Fixed submission:
n = int(input())
li = []
for i in range(n):
    li.append(int(input()))
k = max(li)
l = li.index(k)
for i in range(n):
    if i == l:
        li[i] = 0
        print(max(li))
    else:
        print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = []
for i in range(n):
    li.append(int(input()))
for i in range(n):
    k = li[i]
    li[i] = 0
    print(max(li))
    li[i] = k

Fixed submission:
n = int(input())
li = []
for i in range(n):
    li.append(int(input()))
k = max(li)
l = li.index(k)
for i in range(n):
    if i == l:
        li[i] = 0
        print(max(li))
    else:
        print(k)
Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
e,f,g,h,i,j = b // c,b // d,(a-1) // c,(a-1) // d,b // ((c*d)/math.gcd(c,d)),(a-1) // ((c*d)/math.gcd(c,d))
print(int(b-(e+f-i)-(a-1-(g+h-j))))

Fixed submission:
import math
a,b,c,d = map(int,input().split())
lcm = c*d//(math.gcd(c,d))
e,f,g = b//c - (a-1)//c,b//d - (a-1)//d,b//(lcm) - (a-1)//(lcm)
print(b-a+1-e-f+g)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
li,lia = [],[]
for i in range(m):
    a,b = map(int,input().split())
    li.append(a)
    lia.append(b)
print(min(min(lia)-max(li)+1),0)

Fixed submission:
n,m = map(int,input().split())
li,lia = [],[]
for i in range(m):
    a,b = map(int,input().split())
    li.append(a)
    lia.append(b)
if min(lia)-max(li)+1 <= 0:
    print(0)
else:
    print(min(lia)-max(li)+1)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
li1 = []
for i in range(m):
    a,b = map(int,input().split())
    li2 = []
    for j in range(a,b+1):
        li2.append(j)
    li1.append(set(li2))
for i in range(m):
    li1[0] = li1[0] & li1[i]
print(len(li1[0]))

Fixed submission:
n,m = map(int,input().split())
li,lia = [],[]
for i in range(m):
    a,b = map(int,input().split())
    li.append(a)
    lia.append(b)
if min(lia)-max(li)+1 <= 0:
    print(0)
else:
    print(min(lia)-max(li)+1)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
li = list(map(int,input().split()))
gcd1 = 0
gcd1 = math.gcd(li[0],li[1])
for i in range(2,n):
    gcd1 = math.gcd(gcd1,li[i])
print(gcd1)

Fixed submission:
import fractions
n = int(input())
li = list(map(int,input().split()))
gcd1 = 0
gcd1 = fractions.gcd(li[0],li[1])
for i in range(2,n):
    gcd1 = fractions.gcd(gcd1,li[i])
print(gcd1)
Buggy python submission (verdict: Runtime Error):
s = int(input())
is s == 3 or s == 5 or s == 7:
    print("YES")
else:
    print("NO")

Fixed submission:
s = int(input())
if s == 3 or s == 5 or s == 7:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n = input()
b = input()
if n[0] == "1":
    print(n[1])
else:
    print(n[0])

Fixed submission:
n = input()
b = int(input())
lenn = len(n)
count = 0
for i in range(lenn):
    if n[i] == "1":
        count += 1
    else:
        break
if count >= b:
    print(1)
else:
    print(n[count])
Buggy python submission (verdict: Runtime Error):
n,k = int(input())
if n % k == 0:
    print(0)
else:
    print(1)

Fixed submission:
n,k = map(int,input().split())
if n % k == 0:
    print(0)
else:
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
a = 1
count = 0
for i in range(n):
    a = a*li[i]
while a % 2 == 0:
    a = a // 2
    count += 1
print(count)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
a = 1
count = 0
for i in range(n):
    a = a*li[i]
while a % 2 == 0:
    a = a // 2
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if abs(b-a) =< d and abs(c-b) =< d:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c,d = map(int,input().split())
count = 0
if abs(b-a) <= d and abs(c-b) <= d:
    count = 1
elif abs(c-a) <= d:
    count = 1
if count != 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = input()
n.sort()
if n[0] == "a" and n[1] == "b" and n[2] == "c":
    print("Yes")
else:
    print("No")

Fixed submission:
n = input()
if n.count("a") == 1 and n.count("b") == 1 and n.count ("c") == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())
li,lia = [],[]
for i in range(a,b+1):
    li.append(i)
if k*2 >= b-a+1:
    for i in range(len(li)):
        print(li[i])
    exit()
else:
    for i in range(k):
        lia.append(li[i])
        lia.append(li[-i-1])
    lia.sort()
    for i in range(len(lia)):
        print(lia[i])
    exit()

Fixed submission:
a,b,k = map(int,input().split())
li = []
if k*2 >= b-a+1:
    for i in range(a,b+1):
        li.append(i)
    for i in range(len(li)):
        print(li[i])
else:
    for i in range(k):
        li.append(a+i)
        li.append(b-i)
    li.sort()
    for i in range(len(li)):
        print(li[i])
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(2):
    if n[i] == n[i+1] and n[i+1] == n[i+2]:
        print("Yes")
        exit()
print("No")

Fixed submission:
n = input()
for i in range(2):
    if n[i] == n[i+1] and n[i+1] == n[i+2]:
        print("Yes")
        exit()
print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a - int(input())
print(n**2-a)

Fixed submission:
n = int(input())
a = int(input())
print(n**2-a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
lis = []
x = 0
y = 0
z = 0
for i in range(n):
    if li[i] % 4 == 0:
        x += 1
    elif li[i] % 2 == 0:
        y = 1
    else:
        z += 1
if y = 0:
    if x >= y + 1:
        print("Yes")
    else:
        print("No")
else:
    if x >= y:
        print("Yes")
    else:
        print("No")


Fixed submission:
n = int(input())
li = list(map(int,input().split()))
lis = []
x = 0
y = 0
z = 0
for i in range(n):
    if li[i] % 4 == 0:
        x += 1
    elif li[i] % 2 == 0:
        y = 1
    else:
        z += 1
if y == 0:
    if x + 1 >= z:
        print("Yes")
    else:
        print("No")
else:
    if x >= z:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
li.append(a+b)
for i in range(3):
    if li[i] % 3 == 0:
        print("Possible")
        exit()
print("Impossible")

Fixed submission:
li = list(map(int,input().split()))
li.append(li[0]+li[1])
for i in range(3):
    if li[i] % 3 == 0:
        print("Possible")
        exit()
print("Impossible")
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()
if a[-1] == b[1] and b[-1] == c[1]:
    print("YES")
else:
    print("NO")

Fixed submission:
a,b,c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if b - a = c - b:
    print("YES")
else:
    print("NO")

Fixed submission:
a,b,c = map(int,input().split())
if b - a == c - b:
    print("YES")
else:
    print("NO")