Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
A = np.array([int(input()) for i in range(n)])
idxs = np.argsort(A)
m1 = A[idxs[-1]]
m2 = A[idxs[-2]]
if m1 == m2:
  for i in range(n):
    print(m1)
else:
  for i in range(n):
    if i != idx[-1]:
      print(m1)
    else:
   	  print(m2)

Fixed submission:
import numpy as np
n = int(input())
A = np.array([int(input()) for i in range(n)])
idxs = np.argsort(A)
m1 = A[idxs[-1]]
m2 = A[idxs[-2]]
for i in range(n):
  if i != idxs[-1]:
    print(m1)
  else:
    print(m2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
A = np.array([int(input()) for i in range(n)])
idxs = np.argsort(A)
m1 = A[idxs[-1]]
m2 = A[idxs[-2]]
if m1 == m2:
  for i in range(n):
    print(m1)
else:
  for i in range(n):
    if i != idx[-1]:
      print(m1)
    else:
   	  print(m2)

Fixed submission:
import numpy as np
n = int(input())
A = np.array([int(input()) for i in range(n)])
idxs = np.argsort(A)
m1 = A[idxs[-1]]
m2 = A[idxs[-2]]
for i in range(n):
  if i != idxs[-1]:
    print(m1)
  else:
    print(m2)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
A = np.array([int(input()) for i in range(n)])
for i in range(n):
  m = A.max()
  if A[i] == m:
    print(np.delete(A, i).max())
  else:
    print(m)

Fixed submission:
import numpy as np
n = int(input())
A = np.array([int(input()) for i in range(n)])
idxs = np.argsort(A)
m1 = A[idxs[-1]]
m2 = A[idxs[-2]]
for i in range(n):
  if i != idxs[-1]:
    print(m1)
  else:
    print(m2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
A = np.array([int(input()) for i in range(n)])
for i in range(n):
  m = np.max(A)
  if A[i] == m:
    mask = A != A[i]
    print(np.max(A[mask]))
  else:
    print(m)

Fixed submission:
import numpy as np
n = int(input())
A = np.array([int(input()) for i in range(n)])
idxs = np.argsort(A)
m1 = A[idxs[-1]]
m2 = A[idxs[-2]]
for i in range(n):
  if i != idxs[-1]:
    print(m1)
  else:
    print(m2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
l = list(map(int, input().split()))
n = l[0]
A = np.array(l[1:])
for i in range(n):
  m = np.max(A)
  if A[i] == m:
    mask = A != A[i]
    print(np.max(A[mask]))
  else:
    print(m)

Fixed submission:
import numpy as np
n = int(input())
A = np.array([int(input()) for i in range(n)])
idxs = np.argsort(A)
m1 = A[idxs[-1]]
m2 = A[idxs[-2]]
for i in range(n):
  if i != idxs[-1]:
    print(m1)
  else:
    print(m2)
Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))
count = 0
for i in range(1, l-1):
  ll = l[i-1:i+1]
  ll.sort()
  if ll[1]==l[i]:
    count+=1
print(count)


Fixed submission:
N = int(input())
l = [int(i) for i in input().split()]
count = 0
for i in range(len(l) - 2):
    ll = l[i:i + 3]
    ll.sort()
    if ll[1] == l[i+1]:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))
count = 0
for i in range(l):
  ll = l[i-1:i+1]
  ll.sort()
  if ll[1]==l[i]:
    count+=1
print(count)

Fixed submission:
N = int(input())
l = [int(i) for i in input().split()]
count = 0
for i in range(len(l) - 2):
    ll = l[i:i + 3]
    ll.sort()
    if ll[1] == l[i+1]:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, *arr = map(int, input().split())
arr = np.array(arr)
arr.sort()
m1 = arr[int(N / 2 - 1)]
m2 = arr[int(N / 2)]
print(m2 - m1)

Fixed submission:
import numpy as np

N = int(input())
arr = [int(i) for i in input().split()]
arr = np.sort(arr)
m1 = arr[int(N / 2)-1]
m2 = arr[int(N / 2)]
print(m2 - m1)
Buggy python submission (verdict: Runtime Error):
X, A = map(int, input().split())
if X >= A:
  return 10
else:
  return 0

Fixed submission:
X, A = map(int, input().split())
print(int(X >= A)*10)
Buggy python submission (verdict: Runtime Error):
l = []
for i in range(3):
    l.append(int(input()))
l.sort()
print(l[0]+l[1])

Fixed submission:
l = input().split()
l.sort()
print(int(l[0])+int(l[1]))
Buggy python submission (verdict: Time Limit Exceeded):
import collections

n, l, q = map(int, input().split())
a = [input() for _ in range(q)]

for i in range(n):
    if collections.Counter(a)[str(i+1)] > q-l:
        print("Yes")
    else:
        print("No")

Fixed submission:
import collections

n, l, q = map(int, input().split())
a = [input() for _ in range(q)]
c = collections.Counter(a)

for i in range(n):
    if c[str(i+1)] > q-l:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
ans = map(lambda x: s.count(x)-1, set(s))
ans = sum(map(lambda x: int(x*(x+1)/2), ans))

print(ans)

Fixed submission:
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
t = {}

for i in range(n):
    if s[i] in t:
        t[s[i]] += 1
    else:
        t[s[i]] = 1
ans = sum((i * (i - 1)) // 2 for i in t.values())

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
ans = list(map(lambda x: s.count(x)-1, set(s)))
ans = sum(list(map(lambda x: int(x*(x+1)/2), ans)))

print(ans)

Fixed submission:
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
t = {}

for i in range(n):
    if s[i] in t:
        t[s[i]] += 1
    else:
        t[s[i]] = 1
ans = sum((i * (i - 1)) // 2 for i in t.values())

print(ans)
Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())

for i in range(int(round(y/10000, 0)) + 1):
    for j in range(int(round(y/5000, 0)) + 1):
        for k in range(int(round(y/1000, 0)) + 1):
            if i+j+k > n:
                break
            elif (10000*i) + (5000*j) + (1000*k) == y and i+j+k == n:
                print(i, j, k)
                exit()

print("-1 -1 -1")

Fixed submission:
s = input()
print("2018{}".format(s[4::]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = set([input() for i in range(n)])
print(len(a))

Fixed submission:
s = input()
print("2018{}".format(s[4::]))
Buggy python submission (verdict: Time Limit Exceeded):
N,K= map(int, input().split())
S=[int(x) for x in list(str(input()))]

nums=list()
ds={0:1,1:0}
now=1
cnt=0
for i in S:
    if i==now:
        cnt=cnt+1
    else:
        nums.append(cnt)
        now=ds[now]
        cnt=1

if cnt!=0:
    nums.append(cnt)

if len(nums)%2==0:
    nums.append(0)

Add=2*K+1
ans=0

for i in range(0,len(nums),2):
    tmp=0
    left=i
    right=min(i+Add,len(nums))
    for j in range(left,right):
        tmp=tmp+nums[j]
        
    ans=max(ans,tmp)

print(ans)


Fixed submission:
N,K= map(int, input().split())
S=[int(x) for x in list(str(input()))]

nums=list()
ds={0:1,1:0}
now=1
cnt=0
for i in S:
    if i==now:
        cnt=cnt+1
    else:
        nums.append(cnt)
        now=ds[now]
        cnt=1

if cnt!=0:
    nums.append(cnt)

if len(nums)%2==0:
    nums.append(0)

Add=2*K+1
ans=0
left=0
right=0
tmp=0
for i in range(0,len(nums),2):
    
    nextleft=i
    nextright=min(i+Add,len(nums))
    while nextleft>left:
        tmp=tmp-nums[left]
        left+=1

    while nextright>right:
        tmp=tmp+nums[right]
        right+=1
        

    ans=max(ans,tmp)

print(ans)
Buggy python submission (verdict: Runtime Error):
import math

divisor=[1]
stack=[]
#eiclidean algorithm
A,B=map(int,input().split())
p=max(A,B)
q=min(A,B)
int2=0
gcd=0
while True:
    int2=p%q
    if int2==0:
        gcd=q
        break
    else:
        p=q
        q=int2

stack.append(gcd)
for i in range(2,math.ceil(math.sqrt(gcd))+1):
    if gcd%i==0:
        p=gcd//i
        stack.append(p)
        for x in divisor:
            if i%x==0 and x!=1:
                break
        else:
            divisor+=[i]

while len(stack)!=0:
    p=stack.pop()
    for x in divisor:
        if i%x==0 and x!=1:
            break
    else:
        divisor+=[p]


print(len(divisor))


Fixed submission:
N=int(input())
count=0
for i in range(N+1):
    if i%2==1:
        count+=1

print(count/N)

Buggy python submission (verdict: Runtime Error):
import math

divisor=[1]
stack=[]
#eiclidean algorithm
A,B=map(int,input().split())
p=max(A,B)
q=min(A,B)
int2=0
gcd=0
while True:
    int2=p%q
    if int2==0:
        gcd=q
        break
    else:
        p=q
        q=int2

stack.append(gcd)
for i in range(2,math.ceil(math.sqrt(gcd))+1):
    if gcd%i==0:
        p=gcd//i
        stack.append(p)
        for x in divisor:
            if i%x==0 and x!=1:
                break
        else:
            divisor+=[i]

while len(stack)!=0:
    p=stack.pop()
    for x in divisor:
        if i%x==0 and x!=1:
            break
    else:
        divisor+=[p]


print(len(divisor))


Fixed submission:
N=int(input())
count=0
for i in range(N+1):
    if i%2==1:
        count+=1

print(count/N)
Buggy python submission (verdict: Runtime Error):
import math

a,b=map(int,input().split())
print(ceil((b-1)/(a-1)))

Fixed submission:
import math

a,b=map(int,input().split())
print(math.ceil((b-1)/(a-1)))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input(),split())
if a%2!=b%2:
    print("IMPOSSIBLE")
else:
    print(a+b//2)

Fixed submission:
a,b=map(int,input().split())
if a%2!=b%2:
    print("IMPOSSIBLE")
else:
    print((a+b)//2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
c = []

for i in range(n):
    c.append(a.index(i+1)+1)

print(' '.join(map(str, c)))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
index=[0]*n

for i in range(n):
    index[a[i]-1] = i+1

print(' '.join(map(str, index)))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
c = []

for i in range(n+1):
    c.append(a.index(i)+1)

print(' '.join(map(str, c)))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
index=[0]*n

for i in range(n):
    index[a[i]-1] = i+1

print(' '.join(map(str, index)))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
c = []

for i in b:
    c.append(a.index(i)+1)

print(' '.join(map(str, c)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
index=[0]*n

for i in range(n):
    index[a[i]-1] = i+1

print(' '.join(map(str, index)))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
c = []

for i in b:
    c.append(a.index(i)+1)

print(' '.join(map(str, c)))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
index=[0]*n

for i in range(n):
    index[a[i]-1] = i+1

print(' '.join(map(str, index)))
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
b = [k]*n
for i in a:
    b[i-1] += 1
    b = [j-1 for j in b]

for k in b:
    if k > 0:
        print('Yes')
    else:
        print('No')


Fixed submission:
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
b = [k-q]*n
for i in a:
    b[i-1] += 1

for k in b:
    if k > 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

for _ in range(m):
    a[-1] //= 2
    a.sort()

print(sum(a))


Fixed submission:
import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

for _ in range(m):
    y = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-y//2))

print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

while m:
    a[-1] //= 2
    a.sort()
    m -= 1

print(sum(a))


Fixed submission:
import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

for _ in range(m):
    y = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-y//2))

print(-sum(a))
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

cnt = [0]*(n-1)
for i in range(0, len(h)-2):
    for j in range(i, len(h)-1):
        if h[j] >= h[j+1]:
            cnt[i] += 1
        else:
            break

print(max(cnt))


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

out, cnt = 0, 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
        out = max(out, cnt)
    else:
        cnt = 0

print(out)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

cnt = [0]*(n-1)
for i in range(0, len(h)-1):
    for j in range(i, len(h)-1):
        if h[j] >= h[j+1]:
            cnt[i] += 1
        else:
            break

print(max(cnt))


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

out, cnt = 0, 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
        out = max(out, cnt)
    else:
        cnt = 0

print(out)
Buggy python submission (verdict: Runtime Error):
n = int(input())

print(n(n-1)//2)

Fixed submission:
n = int(input())
print(int(n*(n-1)//2))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
h=list(map(int,input().split()))

maxcnt=0
for i in range(n):
    cnt=0
    for j in range(i+1,n-1):
        if h[j+1] <= h[j]:
            cnt +=1
        else:
            break
    if cnt>maxcnt:
        maxcnt=cnt
print(maxcnt)

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

maxcnt=0
st=0
while st < n-1:
    cnt=0
    j=st
    while j < n-1:
        if h[j+1] <= h[j]:
            cnt +=1
            j += 1
        else:
            break
    if cnt>maxcnt:
        maxcnt=cnt
    st = j+1

print(maxcnt)
Buggy python submission (verdict: Time Limit Exceeded):
import statistics

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

L=0
R=0
DDT = 0
ans = 0
for K in range(statistics.median_low(d)-min(d),statistics.median_low(d)+max(d)):
    for i in range(N):
        if d[i] == K:
            DDT += 1
        elif d[i] < K:
            L += 1
        else:
            R += 1
    if L == R:
        ans += 1
    else:
        while DDT > 0:
            if L < R:
                L += 1
                DDT -= 1
            elif L > R:
                R += 1
                DDT -= 1
            else:
                L += 1
                DDT -= 1
        if L == R:
            ans += 1
    L = 0
    R = 0
    DDT = 0
print(ans-1)

Fixed submission:
N = int(input())
d = input().split()
d = list(map(int,d))

d.sort()

ans = d[N//2] - d[(N//2)-1]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
d = input().split()
d = list(map(int,d))

L=0
R=0
DDT = 0
ans = 0
for K in range(min(d),max(d)+1):
    for i in range(N):
        if d[i] == K:
            DDT += 1
        elif d[i] < K:
            L += 1
        else:
            R += 1
    if L == R:
        ans += 1
    else:
        while DDT > 0:
            if L < R:
                L += 1
                DDT -= 1
            elif L > R:
                R += 1
                DDT -= 1
            else:
                L += 1
                DDT -= 1
        if L == R:
            ans += 1
    L = 0
    R = 0
    DDT = 0
print(ans-1)

Fixed submission:
N = int(input())
d = input().split()
d = list(map(int,d))

d.sort()

ans = d[N//2] - d[(N//2)-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())

ans=N-K+1;

input(ans)

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

ans=N-K+1

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

if a%2==0:
    evena=1

if b%2==0:
    evenb=1

if evena != 1 and evenb != 1:
    print('Yes')
else:
    print('No')

    

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

if a%2==0:
    evena=1

if b%2==0:
    evenb=1

if evena != 1 and evenb != 1:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
def get_common_divisor_list(a,b):
	cd_list = []
	for i in range(1,min(a,b)+1):
		if a%i == 0 and b%i == 0:
			cd_list.append(i)
	return cd_list

def is_coprime(a,b):
	cd_list = get_common_divisor_list(a,b)
	if len(cd_list) == 1 and 1 in cd_list :
		return True
	return False

from math import sqrt
def is_prime(n):
	if n==1:
		return False
	for k in range(2,int(sqrt(n))+1):
		if n%k == 0:
			return False
	return True

def main():
	A,B = map(int,input().split())
	cds = get_common_divisor_list(A,B)
	res = []
	for cd in cds :
		if cd == 1 :
			res.append(1)
			continue
		if is_prime(cd):
			res.append(cd)
	print(len(res))
main()

Fixed submission:
import math
def trial_division(n):
	factor = []
	while n%2 == 0:
		factor.append(2)
		n //= 2
	f = 3
	while f <= math.sqrt(n):
		if n%f == 0:
			factor.append(f)
			n //= f
		else :
			f += 2
	if n!= 1:
		factor.append(n)
	return factor

def main():
	cds = set()
	cds.add(1)
	a,b = map(int,input().split())
	primes_a = trial_division(a)
	primes_b = trial_division(b)
	if primes_a != None and primes_b != None :
		for prime in primes_a:
			if prime in primes_b:
				cds.add(prime)
	print(len(cds))
main()
Buggy python submission (verdict: Runtime Error):
n=int(input())
n=int(input())

def make_divisors(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
p=make_divisors(n)

l=len(p)
if l%2==1:
  ans=p[l-1]*2-2
  
else:
  ans=p[l-1]+p[l-2]-2
  
print(ans)

Fixed submission:
n=int(input())

def make_divisors(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
p=make_divisors(n)

l=len(p)
if l%2==1:
  ans=p[l-1]*2-2
  
else:
  ans=p[l-1]+p[l-2]-2
  
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()

if s="Sunny":
  print("Cloudy")
  
if s="Cloudy":
  print("Rainy")

if s="Rainy":
  print("Sunny")


Fixed submission:
s=input()
 
if s=="Sunny":
  print("Cloudy")
  
if s=="Cloudy":
  print("Rainy")
 
if s=="Rainy":
  print("Sunny")
Buggy python submission (verdict: Runtime Error):
n=int(input())
L=list(map(int,input().split()))
#a,b=map(int,input().split())
A=[0 for i in range(n-1)] 
#l = [int(input()) for i in range(N)]
B=[0 for i in range(n-1)] 
for i in range(n-1):
  A[i]=L[i]-L[i+1]

for i in range(n-1):
  if A[i]>=0:
    B[i]=B[i-1]+1
  else:
    B[i]=0

print(max(B))

Fixed submission:
n=int(input())
if n==1:
  print(0)
else: 
  L=list(map(int,input().split()))
#a,b=map(int,input().split())
  A=[0 for i in range(n-1)] 
#l = [int(input()) for i in range(N)]
  B=[0 for i in range(n-1)] 
  for i in range(n-1):
    A[i]=L[i]-L[i+1]

  for i in range(n-1):
    if A[i]>=0:
      B[i]=B[i-1]+1
    else:
      B[i]=0

  print(max(B))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input

if a>=3200:
  print(s)
else:
  print('red')
#L=list(map(int,input().split()))
#a,b=map(int,input().split())
#A=[[0 for i in range()] for j in range()]
#l = [int(input()) for i in range(N)]

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

if a>=3200:
  print(s)
else:
  print('red')
#L=list(map(int,input().split()))
#a,b=map(int,input().split())
#A=[[0 for i in range()] for j in range()]
#l = [int(input()) for i in range(N)]
Buggy python submission (verdict: Runtime Error):
s=list(map(input().split()))

ans=[]



Fixed submission:
s=list(input())
r=0
l=0
ans=[]
for i,x in enumerate(s):
  if s[i]=='R':
    if s[i-1]=='L'and i>0:
      migi=(r+1)//2+l//2
      hidari=r//2+(l+1)//2
      ans+=[0]*(r-1)+[migi,hidari]+[0]*(l-1)
      r=1
      l=0
    else:r+=1
  else:
    l+=1
migi=(r+1)//2+l//2
hidari=r//2+(l+1)//2
ans+=[0]*(r-1)+[migi,hidari]+[0]*(l-1)
    
print(*ans)
Buggy python submission (verdict: Runtime Error):

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

if (A+B)%2=1:
  print("IMPOSSIBLE")

else:
  print((A+B)/2)

Fixed submission:

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

if (A+B)%2==1:
  print("IMPOSSIBLE")

else:
  print(int((A+B)/2))
Buggy python submission (verdict: Runtime Error):
n=int(input())
L=list(map(int,input().split()))
ans=[0 for i in range(n)]

L=[i for i in L]


m=n//2
a=L[m]

for i in range(1,(n+1)/2):
  a=L[m-i]+L[m+1]-a

ans[0]=a/2

for i in range(1,n):
  ans[i]=L[i]-ans[i-1]
  
print(ans)

Fixed submission:
n=int(input())
L=list(map(int,input().split()))
ans=[0 for i in range(n)]

L=[i*2 for i in L]

m=n//2
a=L[m]

for i in range(1,(n+1)//2):
  a=L[m-i]+L[m+i]-a

ans[0]=a//2

for i in range(1,n):
  ans[i]=L[i-1]-ans[i-1]

print(*ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())

a=n-k+1

for i in range(1,k+1):
  print(a)
  a=a*(n-k+1-i)*(k-i)//((i+1)*i)%1000000007
  




Fixed submission:
s=list(input())
a=s[0]
b=s[1]
c=s[2]
d=s[3]


if a==b and c==d and a!=c:
  print('Yes')
elif a==c and b==d and a!=b:
  print('Yes')
elif a==d and c==b and a!=c:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n=int(input())
L=list(map(int,input().split()))
L.sort
d=L[int(n/2)-1]-L[int(n/2)]


print(d)




Fixed submission:
s=list(input())
a=s[0]
b=s[1]
c=s[2]
d=s[3]


if a==b and c==d and a!=c:
  print('Yes')
elif a==c and b==d and a!=b:
  print('Yes')
elif a==d and c==b and a!=c:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n=int(input())
L=list(map(int,input().split()))
L.sort
d=L[int(n/2)+1]-L[int(n/2)]


print(d)





Fixed submission:
n=int(input())
L=list(map(int,input().split()))
L.sort()
d=L[n//2]-L[n//2-1]

print(d)

Buggy python submission (verdict: Runtime Error):
n=int(input())
L=list(map(int,input().split()))

d=L[int(n/2)+1]-L[int(n/2)]


print(d)




Fixed submission:
n=int(input())
L=list(map(int,input().split()))
L.sort()
d=L[n//2]-L[n//2-1]

print(d)

Buggy python submission (verdict: Runtime Error):
n=int(input())
L=list(map(int,input().split()))

d=L[n/2+1]-L[n/2]


print(d)




Fixed submission:
n=int(input())
L=list(map(int,input().split()))
L.sort()
d=L[n//2]-L[n//2-1]

print(d)
Buggy python submission (verdict: Runtime Error):
n,Xmax=map(int,input().split())
L=list(map(int,input().split()))
x=0
count=1
while x+L[0]<=Xmax:
  count+=1
  x+=L.pop(0)
print(count)

Fixed submission:
n,Xmax=map(int,input().split())
L=list(map(int,input().split()))
x=0
count=1
while x+L[0]<=Xmax:
  count+=1
  x+=L.pop(0)
  if len(L)==0:
    break
print(count)

Buggy python submission (verdict: Runtime Error):
n,Xmax=map(int,input().split())
L=list(map(int,input().split()))
x=0
count=0
while x<Xmax:
  x+=L.pop(0)
  count+=1
print(count)

Fixed submission:
n,Xmax=map(int,input().split())
L=list(map(int,input().split()))
x=0
count=1
while x+L[0]<=Xmax:
  count+=1
  x+=L.pop(0)
  if len(L)==0:
    break
print(count)
Buggy python submission (verdict: Runtime Error):
MOD=10**9+7
n,m=map(int,input().split())
A=[1 for i in range(n)]
if n!=1:
  A[1]=2
  for i in range(m):
    A[int(input())-1]=0
  
  if A[0]==0 and A[1]!=0:
    A[1]=1


  for i in range(2,n):
    if A[i]!=0:
      A[i]=(A[i-1]+A[i-2])
      A[i]%=MOD

    
  print(A[n-1])
  
else:print(1)


Fixed submission:
p,q,r=map(int,input().split())

ans=[p+q,q+r,r+p]
print(min(ans))