Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = input()
height_list = [int(i) for i in input().split()]

count_list = []
for i in range(len(height_list)-1):
    count = 0
    for j in range(i, len(height_list)-1):
        if height_list[j] < height_list[j+1]:
            break
        count += 1
    count_list.append(count)
print(max(count_list))


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

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

Buggy python submission (verdict: Runtime Error):
n = input()
height_list = [int(i) for i in input().split()]

count_list = []
for i in range(len(height_list)-1):
    count = 0
    for j in range(i, len(height_list)-1):
        if height_list[j] >= height_list[j+1]:
            count += 1
    count_list.append(count)
print(max(count_list))


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

count = 0
provisional_max_count = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        count += 1
    else:
        provisional_max_count = max(count, provisional_max_count)
        count = 0
print(max(provisional_max_count, count))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [int(x) for x in input().split()]


def is_valid():
    if n % 2 == 1 and A.count(0) != 1:
        return False

    for a in A:
        if n % 2 == a % 2:
            return False
        if a != 0 and A.count(a) != 2:
            return False
    return True


if not is_valid():
    print(0)
    exit()

print((2**(n//2)) % (10**9+7))


Fixed submission:
n = int(input())
A = [int(x) for x in input().split()]

Bi = []
if n % 2 == 0:
    half_Bi = list(range(1, n, 2))
    Bi = half_Bi + half_Bi
else:
    half_Bi = list(range(2, n, 2))
    Bi = half_Bi + half_Bi
    Bi.append(0)

A.sort()
Bi.sort()
if A != Bi:
    print(0)
    exit()

print((2**(n//2)) % (10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ratios = [tuple(int(x) for x in input().split()) for i in range(n)]

t_votes = 1
a_votes = 1
for ratio in ratios:
    count = 0
    while t_votes > ratio[0]*count or a_votes > ratio[1]*count:
        count += 1
    t_votes = ratio[0] * count
    a_votes = ratio[1] * count
print(t_votes+a_votes)


Fixed submission:
n = int(input())

t_votes = a_votes = 1
for i in range(n):
    t_rate, a_rate = (int(x) for x in input().split())
    count = max(-(-t_votes // t_rate), -(-a_votes // a_rate))
    t_votes = t_rate*count
    a_votes = a_rate*count

print(t_votes+a_votes)
Buggy python submission (verdict: Runtime Error):
hands_a, hands_b, hands_c = (list(input()) for i in range(3))

hands = {'a': hands_a, 'b': hands_b, 'c': hands_c}

turn = 'a'
while len(hands[turn]) > 0:
    turn = hands[turn].popleft()
print(turn.upper())


Fixed submission:
hands_a, hands_b, hands_c = (input() for i in range(3))

hands = {'a': hands_a, 'b': hands_b, 'c': hands_c}

turn = 'a'
while True:
    if len(hands[turn]) == 0:
        print(turn.upper())
        exit()
    next_turn = hands[turn][0]
    hands[turn] = hands[turn][1:]
    turn = next_turn

Buggy python submission (verdict: Runtime Error):
hands_a, hands_b, hands_c = (list(input()) for i in range(3))

hands = {'a': hands_a, 'b': hands_b, 'c': hands_c}

turn = 'a'
while len(hands[turn]) > 0:
    turn = hands[turn].popleft
print(turn.upper())


Fixed submission:
hands_a, hands_b, hands_c = (input() for i in range(3))

hands = {'a': hands_a, 'b': hands_b, 'c': hands_c}

turn = 'a'
while True:
    if len(hands[turn]) == 0:
        print(turn.upper())
        exit()
    next_turn = hands[turn][0]
    hands[turn] = hands[turn][1:]
    turn = next_turn
Buggy python submission (verdict: Runtime Error):
s=list(input())


c=[]
for i in range(3):
  
  if s[i]=='R':
    cnt=0
    
    while i<3:
      if s[i]=='R':
        cnt+=1
        i+=1
        
      else:
        break
        
    c.append(cnt)
    
print(max(c))
        
        

Fixed submission:
s=list(input())


c=[]
for i in range(3):
  cnt=0
  if s[i]=='R':
    
    
    while i<3:
      if s[i]=='R':
        cnt+=1
        i+=1
        
      else:
        break
        
  c.append(cnt)
    
print(max(c))
Buggy python submission (verdict: Runtime Error):
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

from collections import deque
n,m,k=mi()
a=deque(lmi())
b=deque(lmi())
i=0
cnt=0
value=0
while a or b:
  try:
    r=a[i]
  except:
    r=float('inf')
  try:
    q=b[i]
  except:
    q=float('inf')
  if q==r:
    if a[1]<b[1]:
      p=a.popleft()
    elif a[1]>b[1]:
      p=b.popleft()
  else:
    p=min(q,r)
    if p==r:
      p=a.popleft()
    else:
      p=b.popleft()
    
  print(p)
  
  value+=p
  if value>k:
    break
  elif value==k:
    cnt+=1
    break
  cnt+=1
  
  
  
print(cnt)

Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
ruiseki_A = [0]
ruiseki_B = [0]
 
for i in range(len(A)):
    ruiseki_A.append(ruiseki_A[i]+A[i])
for i in range(len(B)):
    ruiseki_B.append(ruiseki_B[i]+B[i])
#print(ruiseki_A)
 
ans = 0
for i in range(len(ruiseki_A)):
    tmp = K - ruiseki_A[i]
    if tmp < 0:
        continue
    r = len(ruiseki_B)
    l = 0
    while r-l > 1:
        mid = (r + l) // 2
        if ruiseki_B[mid] <= tmp:
            l = mid
        else:
            r = mid
    ans = max(ans, i+l)
 
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()



n=ii()
a=lmi()
S=0
for i in a:
  S=S^i

b=[]
for i in a:
  a_=S^i
  b.append(a_)

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

Fixed submission:
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()



n=ii()
a=lmi()
S=0
for i in a:
  S=S^i

b=[]
for i in a:
  a_=S^i
  b.append(a_)

print(' '.join(map(str,b)))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
s=1
ans=0
for i in a:
  s=s*i
  if s>10**18:
    ans=1
   
  else:
    ans=0
    
if ans==1:
  print(-1)
  
else:
  print(s)

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

a.sort()
if a[0]==0:
  print(0)
  
else:
  s=1
  for i in a:
    s*=i
    if s>10**18:
      print(-1)
      exit()
      
  print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
s=1
ans=0
for i in a:
  s=s*i
  if s>10**18:
    ans=1
   
  else:
    ans=0
    
if ans==1:
  print(-1)
  
else:
  print(s)

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

a.sort()
if a[0]==0:
  print(0)
  
else:
  s=1
  for i in a:
    s*=i
    if s>10**18:
      print(-1)
      exit()
      
  print(s)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import math
n=int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)

    return a

s=dict(Counter(prime_factorize(n)))
#print(s)
sum_ans=0
for i in s.values():
  
  if i==1:
    sum_ans+=1
    
  else:
    k=1
    while i:
      i-=k
      k+=1
      #print(i)
      sum_ans+=1
      
print(sum_ans)
      

Fixed submission:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
from collections import Counter
n=int(input())
s=Counter(prime_factorize(n))
t=list(s.values())
cnt=0
#print(s)
#print(t)
for i in t:
  if i==1:
    cnt+=1
    
  else:
    s=1
    while i>0:
      i=i-s
      s+=1
      if i<0:
        break
      cnt+=1
      
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
nedan=[]
grade=[]
inf=12*10**6
for i in range(n):
  s=list(map(int,input().split())) 
  nedan.append(s.pop(0))
  grade.append(s)
#print(nedan)
#print(grade)

for i in range(2**n):
  shopping=[]
  total_grade=[]
  for j in range(n):
    if (( i >> j ) & 1):
      shopping.append(nedan[j])
      total_grade.append(grade[j])

  t=sum(shopping)
  #print(t)
  #print(shopping)
  #print(total_grade)
  sum_grade=[]
  for j in range(m):
    s=0
    for k in range(len(total_grade)):
        s+=total_grade[k][j]
    sum_grade.append(s)
    print(sum_grade)

  ans_t=[]
  if all(j>=x for j in sum_grade):
    ans_t.append(t)

print(ans_t)   
ans=min(ans_t)

if min(ans,inf)==ans:
  print(ans)

else:
  print(-1)

Fixed submission:
import sys
import numpy as np
sys.setrecursionlimit(10**8)

def dfs(i,a,value):
  global ans
  if i==n:
    if all(a[i]>=x for i in range(m)):
      ans=min(ans,value)


  else:
    dfs(i+1,a,value)
    dfs(i+1,a+np.array(pc[i][1:]),value+pc[i][0])


ans=float('inf')
n,m,x=map(int,input().split())
pc=[]
for i in range(n):
  s=list(map(int,input().split()))
  pc.append(s)

dfs(0,np.array([0]*(m)),0)
if ans==float('inf'):
  ans=-1
print(ans)
Buggy python submission (verdict: Runtime Error):
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

n,k=mi()
a=lmi()

s=[]
s.append(1)

o=[-1]*(n+1)
o[1]=0
t=0
while a:
  p=a.pop(0)
  s.append(p)
  if o[p]!=-1:
    pp=t-o[p]
    ss=o[p]
    break
  o[p]=t
  t+=1
#print(ss,pp)
#print(s)
if k<ss:
  print(s[k-1])

else:
  ans=k%pp
  print(s[ss+ans+1])


Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
town=[0]*n
info=[1]
now=1
while town[now-1]==0:
    town[now-1]+=1
    now=a[now-1]
    info.append(now)
loop_list=list(info[info.index(now):-1])
loop_len=len(loop_list)
before_loop_list=list(info[:info.index(now)])
#print(town)
#print(info)
if k<len(before_loop_list):
    print(before_loop_list[k])
else:
    print(loop_list[((k-len(before_loop_list))%loop_len)])
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())

list_n=[]
for i in range(1,N+1):
    list_n.append(i)
    
t=[]
for i in range(K):
    d=int(input())
    s=list(map(int,input().split()))
    t+=s
    
s=set(t)
s.sort()

cnt=0
for i in list_n:
    if i not in s:
        cnt+=1
        
print(cnt)

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

list_n=[]
for i in range(1,N+1):
    list_n.append(i)
    
t=[]
for i in range(K):
    d=int(input())
    s=list(map(int,input().split()))
    t+=s
    
s=list(set(t))
s.sort()

cnt=0
for i in list_n:
    if i not in s:
        cnt+=1
        
print(cnt)
Buggy python submission (verdict: Runtime Error):
x=int(input())
for i in range(-120,120):
  for j in range(-120.120):
    if i**5-j**5==x:
      print(i,j)
      break

Fixed submission:
x=int(input())
for i in range(-120,120):
  for j in range(-120,120):
    if i**5-j**5==x:
      print(i,j)
      exit()

Buggy python submission (verdict: Runtime Error):
for i in range(-120,120):
  for j in range(-120,120):
    if i**5-j**5==x:
      print(i,j)
      break

Fixed submission:
x=int(input())
for i in range(-120,120):
  for j in range(-120,120):
    if i**5-j**5==x:
      print(i,j)
      exit()

Buggy python submission (verdict: Runtime Error):
x=int(input())
for i in range(-120,120):
  for j in range(-120.120):
    if i**5-j**5==x:
      print(i,j)
      break

Fixed submission:
x=int(input())
for i in range(-120,120):
  for j in range(-120,120):
    if i**5-j**5==x:
      print(i,j)
      exit()
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d=map(int,input().split())
cnt=0
while True:
  cnt+=1
  if cnt%2==0:
    s=a-(cnt/2)*d
    if s<=0:
      print('No')
      
  else:
    s=c-(cnt+1)/2*b
    if s<=0:
      print('Yes')

Fixed submission:
a,b,c,d=map(int,input().split())
cnt=0
while True:
  cnt+=1
  if cnt%2==0:
    s=a-(cnt/2)*d
    if s<=0:
      print('No')
      break
      
  else:
    s=c-(cnt+1)/2*b
    if s<=0:
      print('Yes')
      break
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())

a=list(map(int,input().split()))
s=sum(a)

if n-a> 0:
  print(n-a)
  
else:
  print(-1)

Fixed submission:
n,m=map(int,input().split())
 
a=list(map(int,input().split()))
s=int(sum(a))
 
if (n-s)>= 0:
  print(n-s)
  
else:
  print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(str,input().split()))
s=[0]*n

for i in range(1,n):
  s[i-1]=a.count(str(i))
  
  print(s[i-1])

print(0)

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

for i in a:
  s[i-1]+=1

for i in s:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(str,input().split()))
s=[0]*n

for i in range(1,n):
  s[i-1]=a.count(str(i))
  continue
  
for i in s:
  print(i)
  
  
  

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

for i in a:
  s[i-1]+=1

for i in s:
  print(i)
Buggy python submission (verdict: Runtime Error):
N=int(input())
if N.count('7')==0:
  print('No')
  
else:
  print('Yes')

Fixed submission:

N=input()
if N.count('7')==0:
  print('No')
  
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
num=int(input())
list_num=list(input)
for i in range(list_num):
  if i=7:
    return Yes
    
return No
  
    
  


Fixed submission:

N=input()
if N.count('7')==0:
  print('No')
  
else:
  print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
import math
k=int(input())

sum_num=0
for i in range(1,k+1):
  for j in range(1,k+1):
    for l in range(1,k+1):
      s=math.gcd(i,math.gcd(j,l))
      sum_num+=s
      
print(sum_num)

Fixed submission:
import math
k=int(input())

sum_num=0
for i in range(1,k+1):
  for j in range(1,k+1):
    tmp=math.gcd(j,i)
    for l in range(1,k+1):
      s=math.gcd(l,tmp)
      sum_num+=s
      
print(sum_num)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
k=int(input())

sum_num=0
for i in range(1,k+1):
  for j in range(1,k+1):
    for l in range(1,k+1):
      s=np.gcd.reduce([i,j,l])
      sum_num+=s
      
print(sum_num)

Fixed submission:
import math
k=int(input())

sum_num=0
for i in range(1,k+1):
  for j in range(1,k+1):
    tmp=math.gcd(j,i)
    for l in range(1,k+1):
      s=math.gcd(l,tmp)
      sum_num+=s
      
print(sum_num)
Buggy python submission (verdict: Runtime Error):
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=sum(a)
t=math.floor(s/4/m)
a.sort()
for i in a:
  if i<t:
    u=i

  else:
    break
cnt=0
for i in a:
  if i>u:
    cnt+=1

if cnt>=m:
  print('Yes')
  
else:
  print('No')

Fixed submission:
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=sum(a)
t=math.ceil(s/4/m)
a.sort()

cnt=0
for i in a:
  if i>=t:
    cnt+=1

if cnt>=m:
  print('Yes')
  
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=n%k
print(min(s,abs(k-s))

Fixed submission:
n,k=map(int,input().split())
s=n%k
print(min(s,abs(k-s)))

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

s=math.ceil(n/k)
list_t=[]
for i in range(s+1):
  t=abs(n-i*k)
  list_t.append(t)
  
print(min(list_t))
  


Fixed submission:
n,k=map(int,input().split())
s=n%k
print(min(s,abs(k-s)))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n=int(input())
a=list(map(str,input().split()))
s=list(itertools.combinations(a,2))
cnt=0
for i in s:
  if i[0]==i[1]:
    cnt+=1

for i in a:
  c=a.count(i)
  print(cnt-c+1)

Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
s=Counter(a)
sums=0
for k in s.keys():
  sums+=(s[k]-1)*s[k]//2

for i in a:
  print(sums-s[i]+1)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n=int(input())
a=list(map(str,input().split()))
s=list(itertools.combinations(a,2))
cnt=0
for i in s:
  if i[0]==i[1]:
    cnt+=1

for i in a:
  c=a.count(i)
  print(cnt-c+1)

Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
s=Counter(a)
sums=0
for k in s.keys():
  sums+=(s[k]-1)*s[k]//2

for i in a:
  print(sums-s[i]+1)
Buggy python submission (verdict: Runtime Error):
bingo=[]
for i in range(3):
  a=list(map(int,input().split()))
  bingo.append(a)
  
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(3):
    if b in bingo[i]:
      bingo[i][bingo[i].index(b)]=0
      
def hantei(l):
  for i in range(3):
    if all([l[i][j]==0 for j in range(3)]):
      return 'Yes'
    
    elif all([l[j][i]==0 for j in range(3)]):
      return 'Yes'
    
    elif l[0][0]==0 and l[1][1]==0 and l[2][2]==0:
      return 'Yes'
    
    elif l[0][2]==0 and l[1][1]==0 and l[2][0]==0:
      return 'Yes'
    
    else:
      return 'No'
    
print(hantei(bingo))
    
    

Fixed submission:
bingo=[]
for i in range(3):
  a=list(map(int,input().split()))
  bingo.append(a)
  
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(3):
    if b in bingo[j]:
      bingo[j][bingo[j].index(b)]=0
      
def hantei(l):
  for i in range(3):
    if all([l[i][j]==0 for j in range(3)]):
      return 'Yes'
    
    elif all([l[j][i]==0 for j in range(3)]):
      return 'Yes'
    
    elif l[0][0]==0 and l[1][1]==0 and l[2][2]==0:
      return 'Yes'
    
    elif l[0][2]==0 and l[1][1]==0 and l[2][0]==0:
      return 'Yes'
    
    else:
      continue
      
  return 'No'
    
#print(bingo)
print(hantei(bingo))

Buggy python submission (verdict: Runtime Error):
a=[]
for i in range(3):
  aa=list(map(str,input().split()))
  a.append(aa)
  
n=int(input())
ln=[]
for i in range(n):
  lnn=input()
  ln.append(lnn)
  
visited=[[0]*3 for i in range(3)]

for i in range(3):
  for j in range(3):
    for k in range(n):
      if ln[k] in a[i][j]:
        visited[i][j]=1

for j in range(3):
  if all([visited[i][j] for i in range(3)])==1:
    print('Yes')
    exit()
    
for i in range(3):
  if all([visited[i][j] for j in range(3)])==1:
    print('Yes')
    exit()
    
if visited[0][0]==1 and visited[1][1]==1 and visited[2][2]==1:
  print('Yes')
  exis()
  
if visited[0][2]==1 and visited[1][1]==1 and visited[2][0]==1:
  print('Yes')
  exis()
  
print('No')



Fixed submission:
bingo=[]
for i in range(3):
  a=list(map(int,input().split()))
  bingo.append(a)
  
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(3):
    if b in bingo[j]:
      bingo[j][bingo[j].index(b)]=0
      
def hantei(l):
  for i in range(3):
    if all([l[i][j]==0 for j in range(3)]):
      return 'Yes'
    
    elif all([l[j][i]==0 for j in range(3)]):
      return 'Yes'
    
    elif l[0][0]==0 and l[1][1]==0 and l[2][2]==0:
      return 'Yes'
    
    elif l[0][2]==0 and l[1][1]==0 and l[2][0]==0:
      return 'Yes'
    
    else:
      continue
      
  return 'No'
    
#print(bingo)
print(hantei(bingo))
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[]
for i in p:
  t=(1+i)/2
  s.append(t)
lt=[]
for i in range(len(s)-k+1):
  t=sum(s[i:i+k])
  lt.append(t)

print('{:.10f}'.format(max(lt)))

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[]
for i in p:
  t=(1+i)
  s.append(t)
  
t=[0,]
for i in range(n):
  u=t[i]+s[i]
  t.append(u)

ans=0
for i in range(n-k+1):
  ans=max(ans,t[i+k]-t[i])
  

print('{:.10f}'.format(ans/2))

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[]
for i in p:
  t=(1+i)/2
  s.append(t)
lt=[]
for i in range(len(s)-k+1):
  t=sum(s[i:i+k])
  lt.append(t)

print('{:.10f}'.format(max(lt)))

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[]
for i in p:
  t=(1+i)
  s.append(t)
  
t=[0,]
for i in range(n):
  u=t[i]+s[i]
  t.append(u)

ans=0
for i in range(n-k+1):
  ans=max(ans,t[i+k]-t[i])
  

print('{:.10f}'.format(ans/2))

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[]
for i in range(len(p)-k+1):
  t=p[i:i+k]
  s.append(t)
#print(s)
ans=0
for i in range(len(s)):
  sums=0
  for j in range(k):
    sums+=(s[i][j]+1)*s[i][j]/2/s[i][j]
  #print(sums)
  ans=max(ans,sums)
print('{:.10f}'.format(ans))

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[]
for i in p:
  t=(1+i)
  s.append(t)
  
t=[0,]
for i in range(n):
  u=t[i]+s[i]
  t.append(u)

ans=0
for i in range(n-k+1):
  ans=max(ans,t[i+k]-t[i])
  

print('{:.10f}'.format(ans/2))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[]
for i in range(len(p)-k+1):
  t=p[i:i+k]
  s.append(t)
#print(s)
ans=0
for i in range(len(s)):
  sums=0
  for j in range(k):
    sums+=(s[i][j]+1)*s[i][j]/2/s[i][j]
  #print(sums)
  ans=max(ans,sums)
print('{:.10f}'.format(ans))

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[]
for i in p:
  t=(1+i)
  s.append(t)
  
t=[0,]
for i in range(n):
  u=t[i]+s[i]
  t.append(u)

ans=0
for i in range(n-k+1):
  ans=max(ans,t[i+k]-t[i])
  

print('{:.10f}'.format(ans/2))
Buggy python submission (verdict: Runtime Error):
n.m=map(int,input().split())
if n==m:
  print('Yes')
  
else:
  print('No')

Fixed submission:
n,m=map(int,input().split())
if n==m:
  print('Yes')
  
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

n=ii()
a=lmi()
INF=10**9+7
ans=0
for i in range(60):
  x=0
  for j in range(n):

    if (a[j]>>i)&1:
      x+=1

  num=x*(n-x)*2**i
  ans+=num

print(ans%INF)

Fixed submission:
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

n=ii()
a=lmi()
INF=10**9+7
ans=0
for i in range(60):
  x=0
  for j in range(n):

    if (a[j]>>i)&1:
      x+=1

  num=x*(n-x)*2**i
  ans+=num

print(ans%INF)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if len(a)==1 and len(b)==1:
  print(a*b)
else:
  print(-1)

Fixed submission:
a,b=map(str,input().split())
if len(a)==1 and len(b)==1:
  print(int(a)*int(b))
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
cnt=0
for i in h:
  if h<k:
    cnt+=1
    
print(cnt)

Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
cnt=0
for i in h:
  if i>=k:
    cnt+=1
    
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(1,n+1):
  ans.append(str(a.index(i)+1))
  
print(' '.join(ans))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans={}
for i in range(1,n+1):
  ans[a[i-1]]=i
s=list(ans.keys())
s.sort()
for i in s:
  print(ans[i],end=' ')
  
print()

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(1,n+1):
  ans.append(a.index(i)+1)
  
print(' '.join(map(str,ans)))
  

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans={}
for i in range(1,n+1):
  ans[a[i-1]]=i
s=list(ans.keys())
s.sort()
for i in s:
  print(ans[i],end=' ')
  
print()
Buggy python submission (verdict: Runtime Error):
s=input()
wether=['Sunny', 'Cloudy', 'Rainy','Sunny']
for i in wether:
  if s==i:
    print(wether[i+1])
    break
    
    

Fixed submission:
s=input()
wether=['Sunny', 'Cloudy', 'Rainy','Sunny']
for i in range(len(wether)):
  if s==wether[i]:
    print(wether[i+1])
    break