Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import copy

mas_num = int(input())
h = list(map(int, input().split()))
c = copy.copy(h)
d = copy.copy(h)
c.pop(0)
d.pop(0)
d.pop(0)

if h[-2] - 1 > h[-1]:
    print('No')
else:
    for i,j,k in zip(h, c, d):
        if i - 1 > j:
            print('No')
            break
        else:
            if i - 1 > k:
                print('No')
                break
            else:
                print('Yes')
                break

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

ans = "Yes"

if n != 1:
  for i in range(n-1):
    if h[i]-1>h[i+1]:
      ans = "No"
      break
    elif h[i]-1==h[i+1]:
      h[i+1] += 1
      
print(ans)

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

mas_num = int(input())
h = list(map(int, input().split()))
c = copy.copy(h)
d = copy.copy(h)
c.pop(0)
d.pop(0)
d.pop(0)

for i,j,k in zip(h, c, d):
    if i - 1 > j:
        print('No')
        break
    else:
        if i - 2 > k:
            print('No')
            break
        else:
            if h[-2] - 1 > h[-1]:
                print('No')
                break
            else:
                print('Yes')
                break

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

ans = "Yes"

if n != 1:
  for i in range(n-1):
    if h[i]-1>h[i+1]:
      ans = "No"
      break
    elif h[i]-1==h[i+1]:
      h[i+1] += 1
      
print(ans)
Buggy python submission (verdict: Runtime Error):
import copy

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

q = copy.copy(p)

r = q.sort()

kaisu = 0

for i in range(n):
  if p[i] != r[i]:
    kaisu += 1

if kaisu == 0 or kaisu == 2:
  print("YES")
else:
  print("NO")


Fixed submission:
import copy

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

q = copy.copy(p)

q.sort()

kaisu = 0

for i in range(n):
  if p[i] != q[i]:
    kaisu += 1

if kaisu == 0 or kaisu == 2:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0
for i in range(n):
  if b[i] > a[i]:
    ans += a[i]
    b[i] -= a[i]
    if b[i] >= a[i+1]:
      ans += a[i+1]
      a[i+1] = 0
    else:
      ans += b[i]
      a[i+i] -= b[i]
  elif b[i] == a[i]:
    ans += a[i]
  else:
    ans += b[i]

print(ans)

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

ans = 0
if n == 1:
  if b[0] >= a[0]:
    ans = ans + a[0]
  else:
    ans = ans + b[0]
else:
  for i in range(n):
    if b[i] > a[i]:
      ans += a[i]
      b[i] -= a[i]
      if b[i] >= a[i+1]:
        ans += a[i+1]
        a[i+1] = 0
      else:
        ans += b[i]
        a[i+1] -= b[i]
    elif b[i] == a[i]:
      ans += a[i]
    else:
      ans += b[i]

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = [input() for i in range(n)]
m = max(nums)
m2 = sorted(nums)[-2]

[print(m) if nums.count(m) >=2 or nums[i] != m else print(m2) for i in range(n)]

Fixed submission:
n = int(input())
nums = [int(input()) for i in range(n)]
m = max(nums)
m2 = sorted(nums)[-2]
[print(m) if nums[i] != m else print(m2) for i in range(n)]

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

ans=[m if nums.count(m) >=2 or nums[i] != m else sorted(nums)[-2] for i in range(n)]

for i in range(n):
  print(ans[i])

Fixed submission:
n = int(input())
nums = [int(input()) for i in range(n)]
m = max(nums)
m2 = sorted(nums)[-2]
[print(m) if nums[i] != m else print(m2) for i in range(n)]

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

for i in range(n):
  num = nums[i]
  if nums.count(m) >= 2 or num != m:
    print(m)
  else:
    print(sorted(nums)[-2])

Fixed submission:
n = int(input())
nums = [int(input()) for i in range(n)]
m = max(nums)
m2 = sorted(nums)[-2]
[print(m) if nums[i] != m else print(m2) for i in range(n)]
Buggy python submission (verdict: Runtime Error):
n = int(input())
# nums = list(map(int, input().split()))
nums = [int(i) for i in input().split()]

kaisu = 0

while True:
  
"""
  for i in range(n):
    if nums[i] %2 == 0:
      nums[i] = nums[i]/2
      kaisu += 1
    else:
      break
"""
  if [i for i in nums if i % 2 == 1]:
    break
  nums = [i//2 for i in nums]
  kaisu += 1
print(kaisu)


Fixed submission:
n = int(input())
nums = [int(i) for i in input().split()]

kaisu = 0

while True:
  if [i for i in nums if i % 2 == 1]:
    break
  nums = [i//2 for i in nums]
  kaisu += 1
print(kaisu)

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

kaisu = 0

while True:
  for i in range(n):
    if nums[i] %2 == 0:
      nums[i] = nums[i]/2
      kaisu += 1
    else:
      break

print(kaisu)


Fixed submission:
n = int(input())
nums = [int(i) for i in input().split()]

kaisu = 0

while True:
  if [i for i in nums if i % 2 == 1]:
    break
  nums = [i//2 for i in nums]
  kaisu += 1
print(kaisu)
Buggy python submission (verdict: Runtime Error):
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) > sum/(4*int(m)):
        yy+=1
if yy <= int(m):
    print("No")
else:
    print("Yes")

Fixed submission:
a, b, c = input().split()
print(str(c) + " " + str(a) + "  " +  str(b))
Buggy python submission (verdict: Runtime Error):
a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1)]) >= sum/(4*int(a1)):
    print("Yes")
else:
    print("No")


Fixed submission:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy < int(m):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1) - 1]) >= sum/(4*a1):
    print("Yes")
else:
    print("No")


Fixed submission:
n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy < int(m):
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = input().split()
n=int(n)
k=int(k)
while(True):
    if abs(n - k) < n:
        n = abs(n - k)
    else:
        break
print(n)

Fixed submission:
n, k = input().split()
n=int(n)
k=int(k)
if n % k > abs((n % k) - k):
    print(abs((n % k) - k))
else:
    print(n % k)
Buggy python submission (verdict: Runtime Error):
a,b,c = mapt(int,input().split())
res = str(c)+""+str(a)+""+str(b)
print(res)

Fixed submission:
a,b,c = input().split()
print(str(c)+" "+str(a)+" "+str(b))

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

print(a,b,c)

Fixed submission:
a,b,c = input().split()
print(str(c)+" "+str(a)+" "+str(b))

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

arr = [a,b,c]

print(arr[2],arr[0],arr[1])

Fixed submission:
a,b,c = input().split()
print(str(c)+" "+str(a)+" "+str(b))

Buggy python submission (verdict: Runtime Error):
a,b,c = raw_input().split()
arr = [a,b,c]

print(arr[1],arr[2],arr[0])

Fixed submission:
a,b,c = input().split()
print(str(c)+" "+str(a)+" "+str(b))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A =[]
for i in range(N):
  A.append(int(input()))
m = max(A)
j = A.index(m)
for k in range(N):
  if k != j:
    print(m)
  else:
    B = A[:]
    del B[j]
    print(max(B))

Fixed submission:
r = int(input())
print(3 * r * r)
Buggy python submission (verdict: Runtime Error):
s = np.array(input().split()).astype(int)
# =============================================================================
# if s.find("A") >= 0 and s.find("B") >= 0:
#     print("Yes")
# else:
#     print("No")
# =============================================================================

A,B,N = s

print((N//(A+B))*A+np.array(N%(A+B),A).max())

Fixed submission:
import numpy as np

s = np.array(input().split()).astype(int)
# =============================================================================
# if s.find("A") >= 0 and s.find("B") >= 0:
#     print("Yes")
# else:
#     print("No")
# =============================================================================

N,A,B = s

print(N//(A+B)*A + np.array([N%(A+B),A]).min())

# =============================================================================
# A,B = s
# 
# eight =  100/8
# ten = 100/10
# x1 = A*eight
# x2 = A*ten
# if (int)(A * 10/8) != B:
#     print(-1)
# else:
#     print(np.array(x1,x2).min().astype(int))
# =============================================================================
Buggy python submission (verdict: Runtime Error):
N,R = input()

N = int(N)
R = int(R)

if N >= 10:
    print(R)
else:
    print(100*(10-N))

Fixed submission:
N,R = input().split()

N = int(N)
R = int(R)

if N >= 10:
    print(R)
else:
    print(R + 100*(10-N))
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
a = input().split()
import numpy as np
a = np.array(a).astype(int).tolist()
s = []
count = 0
al = False
while(1):
    s = []
    al = False
    for aa in a:
        if aa % 2 == 0:
            s.append(True)
        else:
            s.append(False)
    #print(s)
    if np.count_nonzero(s) == 0:
        break
    count = count + 1
    for i,ss in enumerate(s):
        if ss and not al:
            a[i] = a[i] / 2
            al = True
        elif not ss or al:
            a[i] = a[i];
    
print(count)

Fixed submission:
N = input()
a = input().split()
import numpy as np
a = np.array(a).astype(int).tolist()
count = 0
for aa in a:
    #n = np.log2(a)
    while(True):
        if aa % 2 == 0:
            aa = aa / 2
            count = count + 1
        else :
            break;
    
print(int(count))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, M = input().split()
N = int(N)
M = int(M)

# 2 boat
boat = 2
ab = np.zeros(M)
ab1 = []
abN = []
ok = "IMPOSSIBLE"
for i in range(M):
    a,b = input().split()
    a = int(a)
    b = int(b)
    if a == 1:
        ab1.append(b)
    elif b == N:
        abN.append(a)
for b in ab1:
    for a in abN:
        if a == b:
            ok = "POSSIBLE"
print(ok)

Fixed submission:
import numpy as np
N, M = input().split()
N = int(N)
M = int(M)

# 2 boat
boat = 2
ab = np.zeros(M)
ab1 = []
abN = []
ok = "IMPOSSIBLE"
for i in range(M):
    a,b = input().split()
    a = int(a)
    b = int(b)
    if a == 1:
        ab1.append(b)
    elif b == N:
        abN.append(a)
if len(set(abN) & set(ab1))>=1:
    ok = "POSSIBLE"
print(ok)

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

# 2 boat
boat = 2
ab = []
for i in range(M):
    a,b = input().split()
    a = int(a)
    b = int(b)
    ab.append((a,b))
import numpy as np
ab = np.array(ab)
ok = "IMPOSSIBLE"
for a1 in ab[ab.T[0]==1]:
    # 1 to target N-> ok
    for abbb in ab[ab.T[0]==a1[1]]:
        if abbb[1] == N:
            ok = "POSSIBLE"
            break
print(ok)

Fixed submission:
import numpy as np
N, M = input().split()
N = int(N)
M = int(M)

# 2 boat
boat = 2
ab = np.zeros(M)
ab1 = []
abN = []
ok = "IMPOSSIBLE"
for i in range(M):
    a,b = input().split()
    a = int(a)
    b = int(b)
    if a == 1:
        ab1.append(b)
    elif b == N:
        abN.append(a)
if len(set(abN) & set(ab1))>=1:
    ok = "POSSIBLE"
print(ok)

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

# 2 boat
boat = 2
ab = []
for i in range(M):
    a,b = input().split()
    a = int(a)
    b = int(b)
    ab.append((a,b))
import numpy as np
ab = np.array(ab)
ok = "IMPOSSIBLE"
for a1 in ab[ab.T[0]==1]:
    # 1 to target N-> ok
  
    for abbb in ab[ab.T[0]==a1[1]]:
        
        if abbb[1] == N:
            ok = "POSSIBLE"
print(ok)

Fixed submission:
import numpy as np
N, M = input().split()
N = int(N)
M = int(M)

# 2 boat
boat = 2
ab = np.zeros(M)
ab1 = []
abN = []
ok = "IMPOSSIBLE"
for i in range(M):
    a,b = input().split()
    a = int(a)
    b = int(b)
    if a == 1:
        ab1.append(b)
    elif b == N:
        abN.append(a)
if len(set(abN) & set(ab1))>=1:
    ok = "POSSIBLE"
print(ok)
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = set(map(int, input().split())) 
s=0

for i in range(n):
   for j in range(i+1,n):
      s += d[i]*d[j]
print(s)

Fixed submission:
n = int(input())
d = list(map(int, input().split())) 
s=0
# print(d)
for i in range(n):
   for j in range(i+1,n):
      s += d[i]*d[j]
print(s)
Buggy python submission (verdict: Runtime Error):
# a.py
# N = int(input()) #ここで標準入力
# # print (type(N),N) 

# print(N*N*N)
#### ##################
# b.py
man=0
N = int(input()) #ここで標準入力
A = [input().split() for i in range(3)]
# print(A)
# B全部たす
for i in range(N):
   man=man+int(A[1][i])
#例外処理
for i in range(N-1):
   if(A[0][i]<=A[0][i+1]):
      # print(man)
      cn=int(A[0][i])
      man=man+int(A[2][cn-1])
      # print (cn)

print(man)

Fixed submission:
# a.py
# N = int(input()) #ここで標準入力
# # print (type(N),N) 

# print(N*N*N)
#### ##################
# b.py
man=0
N = int(input()) #ここで標準入力
A = [input().split() for i in range(3)]
# print(A)
# B全部たす
for i in range(N):
   man=man+int(A[1][i])
   # if (i!=N):

#例外処理
for i in range(N-1):
   # if(A[0][i]<=A[0][i+1]):    # 食べる順が i -> i+1 の時
   if(int(A[0][i+1]) == int(A[0][i])+1):
      # print(man)
      ryori_i=int(A[0][i])
      man_c=int(A[2][ryori_i-1])
      man=man+man_c
      # print (cn)

print(man)

Buggy python submission (verdict: Runtime Error):
# a.py
# N = int(input()) #ここで標準入力
# # print (type(N),N) 

# print(N*N*N)
#### ##################
# b.py
man=0

N = int(input()) #ここで標準入力
A = [input().split() for i in range(3)]

# print(A)
# B全部たす
for i in range(N):
   man=man+int(A[1][i])
#例外処理
for i in range(N-1):
   if(A[0][i]<A[0][i+1]):
      # print(man)
      cn=int(A[0][i])
      man=man+int(A[2][cn-1])
      # print (cn)


print(man)

Fixed submission:
# a.py
# N = int(input()) #ここで標準入力
# # print (type(N),N) 

# print(N*N*N)
#### ##################
# b.py
man=0
N = int(input()) #ここで標準入力
A = [input().split() for i in range(3)]
# print(A)
# B全部たす
for i in range(N):
   man=man+int(A[1][i])
   # if (i!=N):

#例外処理
for i in range(N-1):
   # if(A[0][i]<=A[0][i+1]):    # 食べる順が i -> i+1 の時
   if(int(A[0][i+1]) == int(A[0][i])+1):
      # print(man)
      ryori_i=int(A[0][i])
      man_c=int(A[2][ryori_i-1])
      man=man+man_c
      # print (cn)

print(man)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
# sum_a = a[0]+(a[0]-1)+(a[0]-1)
sum_a=0
for i in range(100000000):
   if(sum_a>＝a[1]):
      break
   if(i==0):
      sum_a=a[0]
   else:
      sum_a=sum_a+(a[0]-1)

print(i)


Fixed submission:
a = list(map(int,input().split()))
# sum_a = a[0]+(a[0]-1)+(a[0]-1)
b=0
for i in range(100000000):
   if(a[1]==1):
      break
   if(i==0):
      if(b>=a[1]): 
         break
      b=a[0]
   else:
      if(b>=a[1]):
         break
      b=b+(a[0]-1)

print(i)
Buggy python submission (verdict: Runtime Error):
a=int(input())
s=input()
if (a>=3200):
   print(s)
else:
   print(red)

Fixed submission:
a=int(input())
s=input()
if (a>=3200):
   print(s)
else:
   print("red")
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
x=int(raw_input())  # 1 # 一つの数字のみ
# w, a, b =map(int,raw_input().split())  # 2 3  # 二つの数字
sums=0
for i in range(14145):
    sums += i
    # if x == place:
    # print sum
    # print i
    if sums < x:
        pass
    elif sums >= x:
        print i
        break

Fixed submission:
#coding:utf-8
# x=int(raw_input())  # 1 # 一つの数字のみ
x,y=map(str,raw_input().split())  # 2 3  # 二つの数字
# x,z=raw_input()  # 文字列
# print x,y,z
# sum =/ x[0]+y[0]+y[1]
# s = z[0]
if x =="H":
    print y
elif x =="D":
    if y=="D":
        print "H"
    elif y=="H":
        print "D"
elif x =="D":
    if y =="D":
        print"D"
    elif y =="H":
        print"H"
# prin?t x,y
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def parse(inp):
    n,m = map(int,next(inp).split())
    a = sorted(list(map(int,next(inp).split())))
    bc =[]
    for _ in range(m):
        bc.append(list(map(int,next(inp).split())))
    bc.sort(key = lambda x:x[1],reverse=True)
    return n,m,a,bc
  
def main(inp):
    n,m,a,bc = inp
    for i in range(m):
        for j in range(bc[i][0]):
            if(a[j] < bc[i][1]): a[j] = bc[i][1]
            else: return sum(a)
        a.sort()
    return sum(a)
  
print(main(parse(sys.stdin)))

Fixed submission:
import sys

def parse(inp):
    n,m = map(int,next(inp).split())
    a = sorted(list(map(int,next(inp).split())))
    bc =[]
    for _ in range(m):
        bc.append(list(map(int,next(inp).split())))
    bc.sort(key = lambda x:x[1],reverse=True)
    return n,m,a,bc
  
def main(inp):
    n,m,a,bc = inp
    changable = sum(row[0] for row in bc)
#     print(changable)
    new =[]
    for i in range(m):
        if(len(new)==n): break
        for _ in range(bc[i][0]):
            if(len(new)==n): break
            new.append(bc[i][1])
    if(changable < n):
        for _ in range(n-changable):
            new.append(0)
#     print(new)
        
    for i in range(n):
        if(a[i] < new[i]): a[i] = new[i]
        else: break
    
    return sum(a)
  
print(main(parse(sys.stdin)))
Buggy python submission (verdict: Runtime Error):
import sys

def parse(inp):
    S=list(map(int,list(next(inp))))
    return S

def main(inp):
    S = inp
    ones = sum(S)
    zeros = len(S) - ones
    return 2*min(ones,zeros)
  
print(main(parse(sys.stdin)))

Fixed submission:
import sys

def parse(inp):
    S=list(next(inp))
    return S
  
def main(inp):
    S = inp
    zeros=0
    ones=0
    for i in range(len(S)):
        if(S[i]=='0'): zeros+=1
        elif(S[i]=='1'): ones+=1
            
    return 2*min(ones,zeros)
  
print(main(parse(sys.stdin)))

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

def parse(inp):
    S=list(map(int,list(next(inp))))
    return S

def main(inp):
    S=inp
    i = 0
    count = 0
    while i < len(S)-1:
        if(S[i] != S[i+1]):
            del S[i:i+2]
            i=0
            count += 2
        else: i += 1
            
    return count
  
print(main(parse(sys.stdin)))

Fixed submission:
import sys

def parse(inp):
    S=list(next(inp))
    return S
  
def main(inp):
    S = inp
    zeros=0
    ones=0
    for i in range(len(S)):
        if(S[i]=='0'): zeros+=1
        elif(S[i]=='1'): ones+=1
            
    return 2*min(ones,zeros)
  
print(main(parse(sys.stdin)))
Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
a,b = b,a
a,c = c,a
print(f'{a} {b} {c}')

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

Buggy python submission (verdict: Runtime Error):
    abc = input()
    abc.split(" ")
    print(abc[2] + " " + abc[0] + " " + abc[1])

Fixed submission:
abc = input()
s = abc.split(" ")
print(s[2] + " " + s[0] + " " + s[1])
Buggy python submission (verdict: Runtime Error):
if len(set(list(map(int, input())))) == 2:
  print("Yes")
else:
  print("No")

Fixed submission:
if len(set(list(map(int, input().split())))) == 2:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
st input().split()
kazu = list(map(int, input().split()))
u = input()
a = {st[0]: kazu[0], st[1]: kazu[1]}
a[u] -= 1
print(a[0], a[1])

Fixed submission:
s, t = input().split()
a, b = map(int, input().split())
u = input()
if s == u:
  print(a - 1, b)
else:
  print(a, b - 1)
Buggy python submission (verdict: Runtime Error):
h, a = map(int, input())
print(-(-h // a))

Fixed submission:
h, a = map(int, input().split())
print(-(-h // a))
Buggy python submission (verdict: Runtime Error):
x=int(input())
y=int(input())
z=int(input())
print(z)
print(x)
print(y)

Fixed submission:
n=list(input().split(" "))
print(n[2],end=" ")
print(n[0],end=" ")
print(n[1],end=" ")
Buggy python submission (verdict: Runtime Error):
import re

text = input()
if text[2] == text[3] && text[4] == text[5]:
  return "Yes"
else:
  return "No"

Fixed submission:
text = input()
if len(text) < 6:
  print("No")
elif text[2] == text[3] and text[4] == text[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split(" "))
lis2=[]
for i in range(0,n):
	lis2.append(int(input()))
lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

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

lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split(" "))
lis2=[]
for i in range(0,n):
	lis2.append(int(input()))
lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")

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

lis2=sorted(lis2,reverse=True)
sum1=sum(lis2)
count=0
for i in range(0,m):
  if(lis2[i]>=((1/(4*m))*sum1)):
    count=0
  else:
    count=1
    break
if(count==1):
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):

string = input()
N=int(input())
Que = []
for i in range(N):
	Que.append(input())

for Q in Que:	
	if Q[0] == '1':
		string = string[::-1]
	else:
		T,F,C = Q.split(' ')
		if F == '1':
			string = C + string
		elif F == '2':
			string += C
print(string)

Fixed submission:
string = input()
N=int(input())
Que = []
for i in range(N):
	Que.append(input())

init = ""
end = ""
rev = 2
for Q in Que:	
	if int(Q[0]) == 1:
		if rev != 1:
			rev=1
		else:
			rev=2
	elif int(Q[0])==2:
		T,F,C = Q.split(' ')
		if rev == 1:
			if int(F) == 1:
				F =2
			else:
				F = 1
		if int(F) == 1:
			init = init+C
		elif int(F) == 2:
			end = end + C
final = init[-1::-1]+string+end
if rev == 1:
	print(final[-1::-1])
else:
	print(init[-1::-1]+string+end)

Buggy python submission (verdict: Time Limit Exceeded):
string = input()
for i in range(int(input())):
	Q = input()
	if Q[0] == '1':
		string = string[::-1]
	else:
		T,F,C = Q.split(' ')
		if F == '1':
			string = C + string
		elif F == '2':
			string += C
print(string)


Fixed submission:
string = input()
N=int(input())
Que = []
for i in range(N):
	Que.append(input())

init = ""
end = ""
rev = 2
for Q in Que:	
	if int(Q[0]) == 1:
		if rev != 1:
			rev=1
		else:
			rev=2
	elif int(Q[0])==2:
		T,F,C = Q.split(' ')
		if rev == 1:
			if int(F) == 1:
				F =2
			else:
				F = 1
		if int(F) == 1:
			init = init+C
		elif int(F) == 2:
			end = end + C
final = init[-1::-1]+string+end
if rev == 1:
	print(final[-1::-1])
else:
	print(init[-1::-1]+string+end)
Buggy python submission (verdict: Runtime Error):
A = map(int,input().split())
print(0.5*A[0]*A[1])

Fixed submission:
A = list(map(int,input().split()))
print(A[0]*A[1]//2)

Buggy python submission (verdict: Runtime Error):
A = map(int,input().split())
sort(A)
print(0.5*A[0]*A[1])

Fixed submission:
A = list(map(int,input().split()))
print(A[0]*A[1]//2)

Buggy python submission (verdict: Runtime Error):
A = map(int,input().split())
A.remove(max(A))
print(0.5*(A[0])*(A[1]))

Fixed submission:
A = list(map(int,input().split()))
print(A[0]*A[1]//2)
Buggy python submission (verdict: Runtime Error):
X= int(input())
if X == 3 || X == 7 || X == 5:
	print("YES")
else:
	print("NO")

Fixed submission:
X= int(input())
if X == 3 or X == 7 or X == 5:
	print("YES")
else:
	print("NO")