Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
x.sort(reverse = False)
for i in range(1,n):
    if i in x:
        a = x.count(i)
        print(a)
        for s in range(a):
            del x[0]
    else:
        print(0)
print(0)

Fixed submission:
import collections

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
#x.sort(reverse = False)
c = collections.Counter(x)
for i in range(1,n):
    print(c[i])
print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
x.sort(reverse = False)
for i in range(1,n):
    if i in x:
        a = x.count(i)
        print(a)
        for s in range(a):
            del x[0]
    else:
        print(0)
print(0)

Fixed submission:
import collections

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
#x.sort(reverse = False)
c = collections.Counter(x)
for i in range(1,n):
    print(c[i])
print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
x.sort(reverse = False)
for i in range(1,n):
    a = x.count(i)
    print(a)
    for s in range(a):
        del x[0]
print(0)

Fixed submission:
import collections

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
#x.sort(reverse = False)
c = collections.Counter(x)
for i in range(1,n):
    print(c[i])
print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
for i in range(1,n):
    a = x.count(i)
    print(a)
    for s in range(a):
        del x[0]
print(0)

Fixed submission:
import collections

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
#x.sort(reverse = False)
c = collections.Counter(x)
for i in range(1,n):
    print(c[i])
print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
for i in range(1,n+1):
    print(x.count(i))

Fixed submission:
import collections

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
#x.sort(reverse = False)
c = collections.Counter(x)
for i in range(1,n):
    print(c[i])
print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
for i in range(1,n+1):
    print(x.count(i))

Fixed submission:
import collections

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
#x.sort(reverse = False)
c = collections.Counter(x)
for i in range(1,n):
    print(c[i])
print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
ans = 0
for x in range(1,k+1):
    for y in range(1,k+1):
        for z in range(1,k+1):
            ans += math.gcd(x,math.gcd(y,z))
print(ans)

Fixed submission:
import math
k = int(input())
ans = 0
for x in range(1,k+1):
    for y in range(1,k+1):
        for z in range(1,k+1):
            ans += math.gcd(x,math.gcd(y,z))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
ans = 0
for x in range(1,k+1):
    for y in range(1,k+1):
        for z in range(1,k+1):
            key = []
            key.append(math.gcd(x,math.gcd(y,z)))
            key.append(math.gcd(y,math.gcd(x,z)))
            key.append(math.gcd(z,math.gcd(y,x)))
            ans += max(key)
print(ans)

Fixed submission:
import math
k = int(input())
ans = 0
for x in range(1,k+1):
    for y in range(1,k+1):
        for z in range(1,k+1):
            ans += math.gcd(x,math.gcd(y,z))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
base = input().split()
n = int(base[0])
k = int(base[1])
ans = []
def fnk(a):
  if a>=0:
    return a
  else:
    return a*(-1)
if n%k==0:
  print(0)
elif n%k==1:
  print(1)
else:
  while fnk(n-k) not in ans:
    ans.append(fnk(n-k))
    n = fnk(n-k)
  print(min(ans))


Fixed submission:
base = input().split()
n = int(base[0])
k = int(base[1])
s = n%k
t = k-s
if s>t:
  print(t)
else:
  print(s)

Buggy python submission (verdict: Time Limit Exceeded):
base = input().split()
n = int(base[0])
k = int(base[1])
ans = []
def fnk(a):
  if a>=0:
    return a
  else:
    return a*(-1)
if n%k==0:
  print(0)
else:
  while fnk(n-k) not in ans:
    ans.append(fnk(n-k))
    n = fnk(n-k)
  print(min(ans))


Fixed submission:
base = input().split()
n = int(base[0])
k = int(base[1])
s = n%k
t = k-s
if s>t:
  print(t)
else:
  print(s)

Buggy python submission (verdict: Time Limit Exceeded):
base = input().split()
n = int(base[0])
k = int(base[1])
ans = []
def fnk(a):
  if a>=0:
    return a
  else:
    return a*(-1)
while fnk(n-k) not in ans:
  ans.append(fnk(n-k))
  n = fnk(n-k)
print(min(ans))

Fixed submission:
base = input().split()
n = int(base[0])
k = int(base[1])
s = n%k
t = k-s
if s>t:
  print(t)
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")

Fixed submission:
s = input()
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import copy
n = int(input())
k = input().split()
for i in range(n):
    delk = k[i]
    del k[i]
    solk = copy.copy(k)
    solk.sort(reverse=False)
    ans = 0
    while len(solk)>1:
        cnt = 0
        while solk[0]==solk[1]:
            cnt += 1
            del solk[0]
            if len(solk)==1:
                break
        del solk[0]
        ans += cnt*(cnt+1)//2
    print(ans)
    k.insert(i,delk)

Fixed submission:

import collections as c

n = int(input())

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

x = c.Counter(a)

cnt = {}

for k,v in x.items():
    cnt[k] = v*(v-1)//2
    
s = sum(cnt.values())
    
mcnt = {}

for k,v in x.items():
    mcnt[k] = cnt[k]-(v-2)*(v-1)//2
    
for i in a:
    print(s-mcnt[i])
Buggy python submission (verdict: Runtime Error):
def tax8(n):
    return list(range(int((n-1)*(25/2))),int((n+1)*(25/2))))
    
def tax10(n):
    return list(range(int((n-1)*(10/1))),int((n+1)*(10/1))))

a , b = map(int,input().split())

ans = -1

x = []
for i in range(1,a+1):
    if tax8(i) == a:
        x.extend(i)
        
y = []
for i in range(1,b+1):
    if tax10(i) == b:
        y.extend(i)
        
for i in x:
    if i in y:
        if int(i*(2/25)) == int(i*(1/10)):
            ans = i
            break
    
print(ans)

Fixed submission:
def tax8(n):
    return list(range(int((n-1)*(25/2)),int((n+1)*(25/2))))
    
def tax10(n):
    return list(range(int((n-1)*(10/1)),int((n+1)*(10/1))))

a , b = map(int,input().split())

ans = -1

x = []

x.extend(tax8(a))
        
y = []

y.extend(tax10(b))

for i in x:
    if i in y:
        if int(i*(27/25))-i == a and int(i*(11/10))-i == b:
            ans = i
            break
    
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())

x = []
y = []
ans = [10]*n 

for i in range(m):
    s = input().split()
    x.append(int(s[0]))
    y.append(int(s[1]))

cnt = 0

q = 0

for i in x:
    if i == 1 and y[cnt] == 0 and n!=1:
        print(-1)
        q = 1
        break
    else:
        if ans[i-1] !=10:
            if ans[i-1]==y[cnt]:
                cnt += 1
            else:
                print(-1)
                q = 1
                break
        else:
            ans[i-1] = y[cnt]
            cnt += 1
            
cnt2 = 0

if q ==0:
    for i in ans:
        if i == 10:
            if cnt2 == 0:
                ans[cnt2] = 1
                cnt2 += 1
            else:
                ans[cnt2] = 0
        cnt2 += 1
    for i in ans:
        print(i,end = "")

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

x = []
y = []
ans = [10]*n 

for i in range(m):
    s = input().split()
    x.append(int(s[0]))
    y.append(int(s[1]))

cnt = 0

q = 0

for i in x:
    if i == 1 and y[cnt] == 0 and n!=1:
        print(-1)
        q = 1
        break
    else:
        if ans[i-1] !=10:
            if ans[i-1]==y[cnt]:
                cnt += 1
            else:
                print(-1)
                q = 1
                break
        else:
            ans[i-1] = y[cnt]
            cnt += 1
            
cnt2 = 0

if q ==0:
    for i in ans:
        if i == 10:
            if cnt2 == 0:
                if n == 1:
                    ans[cnt] = 0
                else:
                    ans[cnt2] = 1
            else:
                ans[cnt2] = 0
        cnt2 += 1
    for i in ans:
        print(i,end = "")
Buggy python submission (verdict: Runtime Error):
deta = input().split()
n = deta[0]
r = deta[1]
if n>=10:
    print(r)
else:
    rate = 100*(10-int(n))
    print(rate)

Fixed submission:
deta = input().split()
n = deta[0]
r = deta[1]
if int(n)>=10:
    print(r)
else:
    rate = 100*(10-int(n))+int(r)
    print(rate)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

s = []

t =  set()

for i in range(n):
    k = input()
    s.append(k)
    t.add(k)

t = list(t)

a = []

for i in t:
    a.append([s.count(i),i])

a.sort(reverse = True)

maxa = a[0][0]

ans = []

for i in a:
    if i[0] == maxa:
        ans.append(i[1])
    else:
        break

ans.sort()

for i in ans:
    print(i)

Fixed submission:

import collections as col

n = int(input())

s = []

for i in range(n):
    s.append(input())
    
x = col.Counter(s)

m = 0

x = x.most_common()

ans = []

for i in x:
    if i[1]<m:
        break
    else:
        ans.append(i[0])
        m = i[1]
        
ans.sort()

for i in ans:
    print(i)

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

bariety = []

h = []

for i in range(n):
    t = input()
    if t not in bariety:
        bariety.append(t)
        h.append([1,t])
    else:
        h[bariety.index(t)][0] += 1
    
h.sort(reverse = True)

maxh = h[0][0]

ans = []

for i in h:
    if i[0] == maxh:
        ans.append(i[1])
    else:
        break
        
ans.sort()

for i in ans:
    print(i)

Fixed submission:

import collections as col

n = int(input())

s = []

for i in range(n):
    s.append(input())
    
x = col.Counter(s)

m = 0

x = x.most_common()

ans = []

for i in x:
    if i[1]<m:
        break
    else:
        ans.append(i[0])
        m = i[1]
        
ans.sort()

for i in ans:
    print(i)

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

bariety = []

h = []

for i in range(n):
    t = input()
    if t not in bariety:
        bariety.append(t)
        h.append([t,1])
    else:
        h[bariety.index(t)][1] += 1
        
for i in h:
    i.reverse()
    
h.sort(reverse = True)

maxh = h[0][0]

ans = []

for i in h:
    if i[0] == maxh:
        ans.append(i[1])
        
ans.sort()

for i in ans:
    print(i)

Fixed submission:

import collections as col

n = int(input())

s = []

for i in range(n):
    s.append(input())
    
x = col.Counter(s)

m = 0

x = x.most_common()

ans = []

for i in x:
    if i[1]<m:
        break
    else:
        ans.append(i[0])
        m = i[1]
        
ans.sort()

for i in ans:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())

h = list(map(int,input().split()))

turn = 0

h.sort(reverse = True)

while len(h)>0 and k>0:
    del h[0]
    k -= 1
    
turn += sum(h)

print(turn)

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

h = list(map(int,input().split()))

if k>=n:
    print(0)
    
else:
    h.sort()
    print(sum(h[:n-k]))
Buggy python submission (verdict: Runtime Error):
n,k,s = map(int,input().split())
x = [0]*n
for i in range(k):
    x[i] = s
if s == 1000000000:
    for i in range(k,n+1):
        x[i] = s-1
else:
    for i in range(k,n+1):
        x[i] = s+1
for i in x:
    print(i,end = " ")

Fixed submission:
n,k,s = map(int,input().split())
x = [0]*n
for i in range(k):
    x[i] = s
if s == 1000000000:
    for i in range(k,n):
        x[i] = s-1
else:
    for i in range(k,n):
        x[i] = s+1
for i in x:
    print(i,end = " ")
Buggy python submission (verdict: Runtime Error):
x = int(input())

ans = 0

def prime(x):
    y = x//2+1
    cnt = 0
    for i in range(2,y+1):
        if x%i==0:
            cnt += 1
            
    if cnt == 0:
        return x
    else:
        return 0
        
while ans == 0:
    ans = prime(x)
    x += 1
    
if x == 2:
    print(2)
else:
    print(ans)

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

pro = [0]*n

ac = set([])

ans = 0

pen = 0

for _ in range(m):
    l = input().split()
    s = l[1]
    p = int(l[0])    
    if s == "AC":
        if p not in ac:
            ans += 1
            pen += pro[p-1]
            ac.add(p)
            
    else:
        if p not in ac:
            pro[p-1] += 1
            
print(ans,pen)
Buggy python submission (verdict: Runtime Error):
base = [1,2,3]
for i in range(2):
    del base[int(input())-1]
print(base[0])

Fixed submission:
a = int(input())
b = int(input())
print(6-a-b)
Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())

def lcm(x,y):
    z = int(x*y/math.gcd(x,y))
    return z
    
print(lcm(a,b))

Fixed submission:
import fractions

a,b = map(int,input().split())

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))

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

Fixed submission:
import fractions

a,b = map(int,input().split())

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))

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

Fixed submission:
import fractions

a,b = map(int,input().split())

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))

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

Fixed submission:
import fractions

a,b = map(int,input().split())

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))

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

Fixed submission:
import fractions

a,b = map(int,input().split())

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))

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

a,b = map(int,input().split())

def lcm(x,y):
    return(x*y//math.gcd(x,y))

print(lcm(a,b))

Fixed submission:
import fractions

a,b = map(int,input().split())

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))

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

a,b = map(int,input().split())

def lcm(x,y):
    return(x*y//math.gcd(x,y))

print(lcm(a,b))

Fixed submission:
import fractions

a,b = map(int,input().split())

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))
Buggy python submission (verdict: Runtime Error):
s = input()

ans = 0

rs = s.copy()
rs = rs[::-1]

for i in range(len(s)//2):
    if s[i] != rs[i]:
        ans += 1
        
print(ans)

Fixed submission:
s = list(input())

ans = 0

rs = s.copy()
rs = rs[::-1]

for i in range(len(s)//2):
    if s[i] != rs[i]:
        ans += 1
        
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n%2 == 1:
    print("No")
else:
    s = list(input())
    s1 = s[:n//2].copy()
    s2 = s[n//2:]copy()
    if s1 == s2:
        print("Yes")
    else:
        print("No")

Fixed submission:
n = int(input())

if n%2 == 1:
    print("No")
else:
    s = list(input())
    s1 = s[:n//2]
    s2 = s[n//2:]
    if s1 == s2:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())

t = int(math.sqrt(n))

ans = 0

for i in reversed(range(t)):
    if n % i == 0:
        ans = n//i+i
        break
        
print(ans-2)

Fixed submission:
import math

n = int(input())

t = int(math.sqrt(n))

ans = 0

for i in reversed(range(t+1)):
    if n % i == 0:
        ans = n//i+i
        break
        
print(ans-2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n%2==1:
    print(float(((n+1)/2)/n)
else:
    print(0.5)

Fixed submission:
n = int(input())
if n%2==1:
    print(float(((n+1)/2)/n))
else:
    print(0.5)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse = True)
if n == 1:
    print(a[0]//(2**m))
else:
    for i in range(m):
        a.sort(reverse = True)
        a[0] //= 2
    print(sum(a))

Fixed submission:

import heapq as he

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

for i in range(m):
    he.heappush(a,he.heappop(a)*(-1)//2*(-1))

print(sum(a)*(-1))
Buggy python submission (verdict: Runtime Error):

h = list(map(int,input().split()))

ans = 0

cnt= 0

for i in range(n-2):
    if h[i]>=h[i+1]:
        cnt +=1
        if cnt > ans:
            ans = cnt
        else:
            cnt = 0
            
print(ans)

Fixed submission:
n = int(input())

h = list(map(int,input().split()))

ans = 0

cnt= 0

for i in range(n-1):
    if h[i]>=h[i+1]:
        cnt +=1
        if cnt > ans:
            ans = cnt
    else:
        cnt = 0
            
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

ans = 0

for i in range(n):
    ans += i
    
print(ans)

Fixed submission:
n = int(input())

ans = ((n+1)*n)//2-n
    
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
ans = [0]*len(s)
t = len(s)
for i in range(t):
    if s[i] == "R":
        x = s[i:].index("L")+i
        if (x-i)%2 == 0:
            ans[x] += 1
        else:
            ans[x-1] += 1
    else:
        x = i-list(reversed(s[:i])).index("R")
        if (i-x)%2 == 0:
            ans[x] += 1
        else:
            ans[x-1] += 1
for i in ans:
    print(i,end = " ")
    

Fixed submission:
s = list(input())
ans = [s[0]]
cnt = 1
if len(s) == 1:
    print(s[0],end = "")
    print(1)
else:
    for i in range(len(s)-1):
        if s[i] == s[i+1]:
            cnt += 1
        else:
            ans.append(cnt)
            ans.append(s[i+1])
            cnt = 1
    if s[-1] == s[-2]:
        ans.append(cnt)
    else:
        ans.append(1)
ans2 = [0]*len(s)
sm = 0
for i in range(len(ans)//2):
    sm += ans[2*i+1]
    if ans[i*2] == "L":
        if ans[2*i+1]%2 == 1:
            ans2[sm-ans[i*2+1]] += (ans[2*i+1]+1)//2
            ans2[sm-ans[i*2+1]-1] += (ans[2*i+1]-1)//2
        else:
            ans2[sm-ans[i*2+1]] += (ans[2*i+1])//2
            ans2[sm-ans[i*2+1]-1] += (ans[2*i+1])//2
    else:
        if ans[2*i+1]%2 == 1:
            ans2[sm-1] += (ans[2*i+1]+1)//2
            ans2[sm] += (ans[2*i+1]-1)//2
        else:
            ans2[sm] += (ans[2*i+1])//2
            ans2[sm-1] += (ans[2*i+1])//2
for i in ans2:
    print(i,end = " ")

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
ans = [0]*len(s)
t = len(s)
for i in range(t):
    if s[i] == "R":
        x = s[i:].index("L")+i
        if (x-i)%2 == 0:
            ans[x] += 1
        else:
            ans[x-1] += 1
    else:
        x = i-list(reversed(s[:i])).index("R")
        if (i-x)%2 == 0:
            ans[x] += 1
        else:
            ans[x-1] += 1
for i in ans:
    print(i,end = " ")
    

Fixed submission:
s = list(input())
ans = [s[0]]
cnt = 1
if len(s) == 1:
    print(s[0],end = "")
    print(1)
else:
    for i in range(len(s)-1):
        if s[i] == s[i+1]:
            cnt += 1
        else:
            ans.append(cnt)
            ans.append(s[i+1])
            cnt = 1
    if s[-1] == s[-2]:
        ans.append(cnt)
    else:
        ans.append(1)
ans2 = [0]*len(s)
sm = 0
for i in range(len(ans)//2):
    sm += ans[2*i+1]
    if ans[i*2] == "L":
        if ans[2*i+1]%2 == 1:
            ans2[sm-ans[i*2+1]] += (ans[2*i+1]+1)//2
            ans2[sm-ans[i*2+1]-1] += (ans[2*i+1]-1)//2
        else:
            ans2[sm-ans[i*2+1]] += (ans[2*i+1])//2
            ans2[sm-ans[i*2+1]-1] += (ans[2*i+1])//2
    else:
        if ans[2*i+1]%2 == 1:
            ans2[sm-1] += (ans[2*i+1]+1)//2
            ans2[sm] += (ans[2*i+1]-1)//2
        else:
            ans2[sm] += (ans[2*i+1])//2
            ans2[sm-1] += (ans[2*i+1])//2
for i in ans2:
    print(i,end = " ")
Buggy python submission (verdict: Runtime Error):
x = int(input())
print(3(*x**2))

Fixed submission:
x = int(input())
print(3*(x**2))
Buggy python submission (verdict: Runtime Error):
n ,a , b = map(int,input(),split())
t = n*a
if t>b:
    print(b)
else:
    print(t)

Fixed submission:
n , a , b = map(int,input().split())
t = n*a
if t>b:
    print(b)
else:
    print(t)
Buggy python submission (verdict: Runtime Error):
s = input()
s.sort()
if s[0] == s[1] and s[2] == s[3]:
    print("Yes")
else:
    print("No")

Fixed submission:
s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
 
s = w*h
 
if (w-x)*h > (h-y)*w:
    print(float((w-x))*h,end = " ")
    print(0)
elif (w-x)*h == (h-y)*w:
    print(float((w-x))*h,end = " ")
    print(1)
else:
    print(float((h-y))*w,end = " ")
    print(0)


Fixed submission:
w,h,x,y = map(int,input().split())

if w/2 == x and h/2 == y:
    print(w*h/2,1)
else:
    print(w*h/2,0)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())

s = sum(a,b,c)

print(s-max(a,b,c))

Fixed submission:
a,b,c = map(int,input().split())
 
s = a+b+c
 
print(s-max(a,b,c))
Buggy python submission (verdict: Time Limit Exceeded):

n,m = map(int,input().split())

ans = set(range(1,n+1))

for i in range(m):
    l,r = map(int,input().split())
    x = set(range(l,r+1))
    ans = ans & x
    
print(len(ans))
    

Fixed submission:

n,m = map(int,input().split())

ans,ansf = 1,n

for i in range(m):
    l,r = map(int,input().split())
    ans = max(ans,l)
    ansf = min(ansf,r)
    
if ansf - ans <0:
    print(0)
else:
    print(ansf-ans+1)
Buggy python submission (verdict: Runtime Error):
a,b,t = map(int,input().split)

print(b*(a//t))

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

print(b*(t//a))
Buggy python submission (verdict: Runtime Error):

n,k = map(int,input().split())

s = list(map(int,input()))

ans = 0

x = []

f = s[0]

z = 0
o = 0
ans = 0

for i in s:
    if i == 0:
        if f == 1:
            x.append(o)
            o = 0
            z += 1
            f = 0
        else:
            z += 1
    else:
        if f == 0:
            x.append(z)
            z = 0
            o += 1
            f = 1
        else:
            o += 1
    
if s[-1] != s[-2]:
    x.append(1)
else:
    x[-1] += 1
    
    
    
if k > len(x):
    print(sum(x))
else:
    for i in range(len(x)-k):
        ans = max(ans,sum(x[i:i+k+1]))
    print(ans)
    

Fixed submission:
n,k = map(int,input().split())
s = list(map(int,list(input())))
x = [-1]
for i in range(n-1):
    if s[i] != s[i+1]:
        x.append(i)
x.append(n-1)
t = len(x)
ans = 1

for i in range(t-1):
    if i%2 == s[0]:
        ans = max(ans,x[min(t-1,i+2*k)]-x[i])
    else:
        ans = max(ans,x[min(t-1,i+2*k+1)]-x[i])

print(ans)