Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
total = 0

for i in range(n):
  a,b = map(int,split().input())
  if a == b:
    total += 1
    if total == 3:
      break
  else:
    total = 0
if total == 3:
  print('Yes')
else:
  print('No')

Fixed submission:
n = int(input())
total = 0

for i in range(n):
  a,b = map(int, input().split())
  if a == b:
    total += 1
    if total == 3:
      break
  else:
    total = 0
if total == 3:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n, x, t = map(int, input().split())
a = n/x
if n % x == 0:
  print(a*t)
else:
  print((a + 1)*t


Fixed submission:
n, x, t = map(int, input().split())
a = n // x
if n % x == 0:
  print(a * t)
else:
  print((a + 1) * t)

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

print((n//=x + 1) * t )

Fixed submission:
n, x, t = map(int, input().split())
a = n // x
if n % x == 0:
  print(a * t)
else:
  print((a + 1) * t)
Buggy python submission (verdict: Runtime Error):
a = input()
total = 0
for i in a[range(1,4)]:
  if i = 'R':
    total +=1
  else:
    total = 0


Fixed submission:
a = input()
if a =='SSS':
  print(0)
elif a=='RRR':
  print(3)
elif a == 'RRS' or a== 'SRR':
  print(2)
else:
  print(1)

Buggy python submission (verdict: Runtime Error):
a = input()
total = 0
for i in a[range(1,4)]:
  if i = R:
    total +=1
  else:
    total = 0

Fixed submission:
a = input()
if a =='SSS':
  print(0)
elif a=='RRR':
  print(3)
elif a == 'RRS' or a== 'SRR':
  print(2)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
u = 0

if s == t:
  print(0)
else:
  for i in range(len(s)):
    if s[i] != t[i]:
      u += 1
    else:
      path

print(u)


Fixed submission:
s = input()
t = input()
u = 0

if s == t:
  print(0)
else:
  for i in range(len(s)):
    if s[i] != t[i]:
      u += 1
  print(u)
Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
i = 0
count = 0
while (i < N):
    p, q = map(int, input().split())
    d = math.sqrt(p*p + q*q)
    if (d <= D):
        count+= 1
    i+= 1
print(i)

Fixed submission:
N, D = map(int, input().split())
i = 0
count = 0
while (i < N):
    p, q = map(int, input().split())
    d = (p*p + q*q) ** 0.5
    if (d <= D):
        count+= 1
    i+= 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n,m,k=map(int,input().split())
l=list(map(int,input().split()))
ll=list(map(int,input().split()))

l_l=[0]
for i in range(1,m+1):
  l_l.append(l_l[i-1]+ll[i-1])

ans=0
for i in range(m+1):
  if l_l[i]>k:
    break
  
  sm=0
  j=0
  while j<n and l_l[i]+sm+l[j]<=k:
    sm+=l[j]
    j+=1
  ans=max(ans,i+j)
print(ans)

Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)

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

l_ans=[]
for i in range(m+1):
  l_ans.append([0]*(n+1))
ct=0

for i in range(m+1):
  we=i+n
  for j in range(n+1):
    if i==0 and j==0:
      l_ans[i][j]=0
    elif i==0:
      l_ans[i][j]=l_ans[i][j-1]+l[j-1]
    elif j==0:
      l_ans[i][j]=l_ans[i-1][j]+ll[i-1]
    else:
      l_ans[i][j]=l_ans[i][j-1]+l[j-1]
    
    if l_ans[i][0]>k:
      we=0
      break
    if l_ans[i][j]>k:
      we=i+j-1
      break
    elif l_ans[i][j]==k:
      we=i+j
      break
  
  #print(ct,we)

  if we>ct:
    ct=we
#print(l_ans)
print(ct)

Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)

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

l_ans=[]
for i in range(m+1):
  l_ans.append([0]*(n+1))
ct=0

for i in range(m+1):
  we=i+n
  for j in range(n+1):
    if i==0 and j==0:
      l_ans[i][j]=0
    elif i==0:
      l_ans[i][j]=l_ans[i][j-1]+l[j-1]
    elif j==0:
      l_ans[i][j]=l_ans[i-1][j]+ll[i-1]
    else:
      l_ans[i][j]=l_ans[i][j-1]+l[j-1]
    
    if l_ans[i][0]>k:
      we=0
    elif l_ans[i][j]>k:
      we=i+j-1
      break
    elif l_ans[i][j]==k:
      we=i+j
      break
  
  #print(ct,we)

  if we>ct:
    ct=we
#print(l_ans)
print(ct)


Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=2019
numMultiples = 0
seenRemainders = []
for i in range(len(s)):
  l={}
  seenRemainders.append(l)
for i in range(len(s)):
    remainder = 0
    prefixesFound = 0
    for j in range(i,len(s)):
        remainder = (10 * remainder + int(s[j])) % k
        if remainder not in seenRemainders[j]:  
            seenRemainders[j][remainder]=1
        else:
            break
        if remainder == 0:
            prefixesFound+=1
    numMultiples += prefixesFound * (prefixesFound + 1) // 2
print(numMultiples)

Fixed submission:
mod=2019
s=input()

d={}
temp=1
cnt=0
we=0
d[0]=1
for i in range(len(s)):
  we=(we+int(s[-1-i])*temp)%mod
  temp=temp*10%mod
  
  if we not in d:
    d[we]=1
  else:
    d[we]+=1

#print(d)
for i in d:
  cnt+=(d[i]*(d[i]-1))//2
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=2019
numMultiples = 0
seenRemainders = []
for i in range(len(s)):
  l={}
  seenRemainders.append(l)
for i in range(len(s)):
    remainder = 0
    prefixesFound = 0
    for j in range(i,len(s)):
        remainder = (10 * remainder + int(s[j])) % k
        if remainder not in seenRemainders[j]:  
            seenRemainders[j][remainder]=1
        else:
            break
        if remainder == 0:
            prefixesFound+=1
    numMultiples += prefixesFound * (prefixesFound + 1) // 2
print(numMultiples)

Fixed submission:
mod=2019
s=input()

d={}
temp=1
cnt=0
we=0
d[0]=1
for i in range(len(s)):
  we=(we+int(s[-1-i])*temp)%mod
  temp=temp*10%mod
  
  if we not in d:
    d[we]=1
  else:
    d[we]+=1

#print(d)
for i in d:
  cnt+=(d[i]*(d[i]-1))//2
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=2019
numMultiples = 0
seenRemainders = []
for i in range(len(s)):
  l=[]
  seenRemainders.append(l)
for i in range(len(s)):
    remainder = 0
    prefixesFound = 0
    for j in range(i,len(s)):
        remainder = (10 * remainder + int(s[j])) % k
        if remainder not in seenRemainders[j]:  
            seenRemainders[j].append(remainder)
        else:
            break
        if remainder == 0:
            prefixesFound+=1
    numMultiples += prefixesFound * (prefixesFound + 1) // 2
print(numMultiples)

Fixed submission:
mod=2019
s=input()

d={}
temp=1
cnt=0
we=0
d[0]=1
for i in range(len(s)):
  we=(we+int(s[-1-i])*temp)%mod
  temp=temp*10%mod
  
  if we not in d:
    d[we]=1
  else:
    d[we]+=1

#print(d)
for i in d:
  cnt+=(d[i]*(d[i]-1))//2
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
count=0
for _ in range(int(input())):
  l=list(map(str,input().split()))
  
  if l[0]=='1':
    count+=1
  elif count%2==0:
    if l[1]=='1':
      s=l[2]+s
    else:
      s=s+l[2]
  else:
    if l[1]=='2':
      s=l[2]+s
    else:
      s=s+l[2]
if count%2!=0:
  s=s[::-1]
print(s)

Fixed submission:
s=input()
count=0
s1=str()
s2=str()
for _ in range(int(input())):
  l=list(map(str,input().split()))
  
  if l[0]=='1':
    count+=1
  elif count%2==0:
    if l[1]=='1':
      s1=l[2]+s1
    else:
      s2=s2+l[2]
  else:
    if l[1]=='2':
      s1=l[2]+s1
    else:
      s2=s2+l[2]
s=s1+s+s2
if count%2!=0:
  s=s[::-1]
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
count=0
for _ in range(int(input())):
  l=list(map(str,input().split()))
  
  if l[0]=='1':
    count+=1
  elif count%2==0:
    if l[1]=='1':
      s=l[2]+s
    else:
      s=s+l[2]
  else:
    if l[1]=='2':
      s=l[2]+s
    else:
      s=s+l[2]
if count%2!=0:
  s=s[::-1]
print(s)

Fixed submission:
s=input()
count=0
s1=str()
s2=str()
for _ in range(int(input())):
  l=list(map(str,input().split()))
  
  if l[0]=='1':
    count+=1
  elif count%2==0:
    if l[1]=='1':
      s1=l[2]+s1
    else:
      s2=s2+l[2]
  else:
    if l[1]=='2':
      s1=l[2]+s1
    else:
      s2=s2+l[2]
s=s1+s+s2
if count%2!=0:
  s=s[::-1]
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
for _ in range(int(input())):
  l=list(map(str,input().split()))
  
  if l[0]=='1':
    s=s[::-1]
  else:
    if l[1]=='1':
      s=l[2]+s
    else:
      s=s+l[2]
print(s)

Fixed submission:
s=input()
count=0
s1=str()
s2=str()
for _ in range(int(input())):
  l=list(map(str,input().split()))
  
  if l[0]=='1':
    count+=1
  elif count%2==0:
    if l[1]=='1':
      s1=l[2]+s1
    else:
      s2=s2+l[2]
  else:
    if l[1]=='2':
      s1=l[2]+s1
    else:
      s2=s2+l[2]
s=s1+s+s2
if count%2!=0:
  s=s[::-1]
print(s)
Buggy python submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
d={}
flag=0

for i in range(n):
  if l[i] in d:
    flag=1
    break
    
if flag==0:
  print("YES")
else:
  print("NO")

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
d={}
flag=0

for i in range(n):
  if l[i] in d:
    flag=1
    break
  else:
    d[l[i]]=1
    
if flag==0:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

d = 0
C = 0 # SUM

for j in range(1,N):
    d = 0 
    divisors = []
    for i in range(1, int(j**0.5)+1):
        if j % i == 0:
            divisors.append(i)
            if i != j // i:
                divisors.append(j//i)
           
    #d= len(set(divisors))
    C = C + len(set(divisors))
print(C)

Fixed submission:
from sys import stdin
input = stdin.buffer.readline

N = int(input())
tmp = 0

for a in range(1,N):
    tmp = tmp + (N-1) // a
    
print(tmp)
Buggy python submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print a[int(input())-1]

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[int(input())-1])

Buggy python submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print a[int(input)-1]

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[int(input())-1])
Buggy python submission (verdict: Runtime Error):
2**log2(int(input().split()[0]))-1



Fixed submission:
import math

h = int(input())
atk = 0
for i in range(int(math.log2(h)) + 1):
    atk += 2 ** i

print(atk)

Buggy python submission (verdict: Runtime Error):
print(2**log2(int(input()))-1)


Fixed submission:
import math

h = int(input())
atk = 0
for i in range(int(math.log2(h)) + 1):
    atk += 2 ** i

print(atk)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

stairs = list(map(int, input().split(" ")))

for i in range(N):
    stair = stairs[i]
    if stair - 2 >= min(stairs[i:]):
        print("No")
        exit(0)

print("Yes")


Fixed submission:
N = int(input())

stairs = list(map(int, input().split(" ")))
min = 0

for i in range(N):
    stair = stairs[i]
    if min > stair:
        print("No")
        exit(0)
    if stair - 1 > min:
        min = stair - 1

print("Yes")

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

stairs = list(map(int, input().split(" ")))

for i in range(N):
    stair = stairs[i]
    for j in stairs[i:]:
        if stair - 2 >= j:
            print("No")
            exit(0)

print("Yes")


Fixed submission:
N = int(input())

stairs = list(map(int, input().split(" ")))
min = 0

for i in range(N):
    stair = stairs[i]
    if min > stair:
        print("No")
        exit(0)
    if stair - 1 > min:
        min = stair - 1

print("Yes")
Buggy python submission (verdict: Runtime Error):
osatsu, okane = map(int, input().split())

#1万円の枚数 : x
#5千円の枚数 : y
#千円の枚数  : z

x_max = okane // 10_000

for x in range(x_max + 1):
    z_max = (okane // 1_000)
    tmp = z_max - osatsu - 9 * x
    if tmp % 4 != 0 or tmp < 0:
        continue
    y = tmp // 4
    z = osatsu - x - y
    if z < 0:
        continue

    print(x,y,z)
    break
else:
    print(-1, -1, -1)


Fixed submission:
osatsu, okane = map(int, input().split())

#1万円の枚数 : x
#5千円の枚数 : y
#千円の枚数  : z

x_max = okane // 10000

for x in range(x_max + 1):
    z_max = (okane // 1000)
    tmp = z_max - osatsu - 9 * x
    if tmp % 4 != 0 or tmp < 0:
        continue
    y = tmp // 4
    z = osatsu - x - y
    if z < 0:
        continue

    print(x,y,z)
    break
else:
    print(-1, -1, -1)

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

def otosidama(N,Y):
    for y in range(N+1,-1,-1):
        if y*10000 > Y:
            continue
        for i in range(N+1-y):
            if (N-y-i)*1000 > Y-y*10000:
                break
            elif i*5000 > Y-y*10000:
                continue
            for h in range(N+1-y-i,-1,-1):
                if y*10000 + i*5000 + h*1000 == Y and y + i + h == N:
                    return y,i,h
    
    return -1,-1,-1

if Y > N*10000:
    print(-1,-1,-1)
else:
    y,i,h = otosidama(N,Y)
    print(y,i,h)

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

def otosidama(N,Y):
    for y in range(N+1,-1,-1):
        if y*10000 > Y:
            continue
        for i in range(N+1-y):
            if (N-y-i)*1000 > Y-y*10000:
                break
            else:
                if y*10000 + i*5000 + (N-y-i)*1000 == Y:
                    return y,i,N-y-i
    
    return -1,-1,-1

if Y > N*10000:
    print(-1,-1,-1)
else:
    y,i,h = otosidama(N,Y)
    print(y,i,h)

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

def otosidama(N,Y):
    for y in range(N+1,-1,-1):
        if y*10000 > Y:
            continue
        for i in range(N+1-y,-1,-1):
            if i*5000 > Y-y*10000:
                continue
            for h in range(N+1-y-i,-1,-1):
                if y*10000 + i*5000 + h*1000 == Y and y + i + h == N:
                    return y,i,h
    
    return -1,-1,-1

if Y > N*10000:
    print(-1,-1,-1)
else:
    y,i,h = otosidama(N,Y)
    print(y,i,h)

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

def otosidama(N,Y):
    for y in range(N+1,-1,-1):
        if y*10000 > Y:
            continue
        for i in range(N+1-y):
            if (N-y-i)*1000 > Y-y*10000:
                break
            else:
                if y*10000 + i*5000 + (N-y-i)*1000 == Y:
                    return y,i,N-y-i
    
    return -1,-1,-1

if Y > N*10000:
    print(-1,-1,-1)
else:
    y,i,h = otosidama(N,Y)
    print(y,i,h)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())

suma = 0

for i in range(k):
    if a == 0 and b == 0:
        suma = suma - k
        break
    elif a == 0 and c == 0:
        break
    elif b == 0 and c == 0:
        suma = suma + k
        break
    if a > 0:
        a = a - 1
        k = k - 1
        suma += 1
    elif b > 0:
        b = b - 1
        k = k - 1
    elif c > 0:
        c = c - 1
        k = k - 1
        suma -= 1
print(suma)

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

suma = 0


if k > a:
    if k > a + b:
        if k == a + b + c:
            print(a - c)
        else:
            k = k - (a + b)
            print(a-k)
    else:
        print(a)
else:
    print(k)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())

suma = 0

for i in range(k):
    if a > 0:
        a = a - 1
        suma += 1
    elif b > 0:
        b = b - 1
    elif c > 0:
        c = c - 1
        suma -= 1
print(suma)


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

suma = 0


if k > a:
    if k > a + b:
        if k == a + b + c:
            print(a - c)
        else:
            k = k - (a + b)
            print(a-k)
    else:
        print(a)
else:
    print(k)
Buggy python submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input().split())

flag = 0
for i in range(1000):
    if (a <= k * (i+1) and (b >= k * (i+1):
        print("OK")
        flag=1
        break
if flag != 1:
    print("NO")

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

flag = 0
for i in range(1000):
    if (a <= k * (i+1)) and (b >= k * (i+1)):
        print("OK")
        flag = 1
        break
if flag != 1:
    print("NG")
Buggy python submission (verdict: Runtime Error):
s,w = map(int,input().split())
 
if s > w:
  print(safe)
else:
  print(unsafe)

Fixed submission:
s,w = map(int,input().split())
 
if s > w:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
s,w = map(int,input().split())

if s >= w:
  print(safe)
else:
  print(unsafe)

Fixed submission:
s,w = map(int,input().split())
 
if s > w:
  print("safe")
else:
  print("unsafe")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = []
s = [0] * n
a.append(input().split())

for i in range(n - 1):
    a[0][i] = int(a[0][i])
    for j in range(a[0][i]+1):
        if j == a[0][i]:
            s[j - 1] += 1
            break

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

Fixed submission:
n = int(input())

a = []
s = [0] * n
a.append(input().split())

for i in range(n - 1):
    a[0][i] = int(a[0][i])
    s[a[0][i]-1] += 1

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

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

a = []
s = [0] * n
a.append(input().split())

for i in range(n - 1):
    a[0][i] = int(a[0][i])
    for j in range(n):
        if j == a[0][i]:
            s[j - 1] += 1
            break

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


Fixed submission:
n = int(input())

a = []
s = [0] * n
a.append(input().split())

for i in range(n - 1):
    a[0][i] = int(a[0][i])
    s[a[0][i]-1] += 1

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

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

a = []
s = [0] * n
a.append(input().split())

for i in range(n-1):
    a[0][i] = int(a[0][i])

for i in range(n-1):
    for j in range(n):
        if j == a[0][i]:
            s[j - 1] += 1
            break

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

Fixed submission:
n = int(input())

a = []
s = [0] * n
a.append(input().split())

for i in range(n - 1):
    a[0][i] = int(a[0][i])
    s[a[0][i]-1] += 1

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

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

a = []
s = [0] * n
a.append(input().split())

for i in range(n-1):
    a[0][i] = int(a[0][i])

for i in range(n-1):
    for j in range(n):
        if j == a[0][i]:
            s[j-1] += 1

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


Fixed submission:
n = int(input())

a = []
s = [0] * n
a.append(input().split())

for i in range(n - 1):
    a[0][i] = int(a[0][i])
    s[a[0][i]-1] += 1

for i in range(n):
    print(s[i])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

cnt=0

for i in range(1,N+1):
  for j in range(1,N+1):
    buf=N-i*j
    if buf>0:
      cnt+=1
    else:
      break

print(cnt)


Fixed submission:
N=int(input())

cnt=0

for i in range(1,N+1):
  for j in range(1,i+1):
    buf=N-i*j
    if buf>0:
      if i==j:
        cnt+=1
      else:
        cnt+=2
    else:
      break
  

print(cnt)
Buggy python submission (verdict: Runtime Error):
H,W,M=map(int,input().split())
MX=[0]*H
MY=[0]*W
MA=[0]*M

for i in range(M):
  x,y=map(int,input().split())
  x-=1
  y-=1
  MX[x]+=1
  MY[y]+=1
  MA[i]=(x,y)
xmax=max(MX)
ymax=max(MY)
ix=[x[0] for x in enumerate(MX) if x[1]==xmax]
iy=[x[0] for x in enumerate(MY) if x[1]==ymax]

i=0
j=0
for x,y in MA:
  if x in ix or y in iy:
    pass
  else:
    i+=1
  
  j+=1
  
  if len(ix)*len(iy)-j>M-i:
    print(xmax+ymax)
else:
  print(xmax+ymax-1)


Fixed submission:
N,X,T=input().split()

print(((int(N)-1)//int(X)+1)*int(T))

Buggy python submission (verdict: Runtime Error):
import numpy as np

H,W,M=input().split()
H=int(H)
W=int(W)
M=int(M)
MA=np.zeros((H,W),dtype=int64)
MX=[0]*H
MY=[0]*W
for i in range(M):
  x,y=input().split()
  MA[int(x)-1,int(y)-1]=1

MX=np.sum(MA,axis=1)
MY=np.sum(MA,axis=0)

xmax=max(MX)
ymax=max(MY)
ix=[x[0] for x in enumerate(MX) if x[1]==xmax]
iy=[x[0] for x in enumerate(MY) if x[1]==ymax]

ii=min([MA[x,y] for x in ix for y in iy])

print(xmax+ymax-ii)


Fixed submission:
N,X,T=input().split()

print(((int(N)-1)//int(X)+1)*int(T))
Buggy python submission (verdict: Runtime Error):
X, K, D = map(int, input().split())
X=abs(X)
if D>=X and K%2==0:
    ans=X
elif D>=X and K%2==1:
    ans=D-X
elif D<X and K*D<X:
    ans=X-K*D
else:
    ans=X%D
    if (X-ans)%2==0:
        ans=D-ans
print(ans)

Fixed submission:
S=input()
for i in range(0,3):
    if S[0]=="R" and S[1]=="R" and S[2]=="R":
        x=3
    elif S[0]=="R" and S[1]=="R":
        x=2
    elif S[1]=="R" and S[2]=="R":
        x=2
    elif S[0]=="R" or S[1]=="R" or S[2]=="R":
        x=1
    else:
        x=0
print(x)
Buggy python submission (verdict: Runtime Error):
X = float(input())
if X=>30:
  print("Yes")
else
  print("No")

Fixed submission:
X = float(input())
if X>=30:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
sum=0
for i in range(0,N):
    X, Y = map(int, input().split())
    if sqrt(X^2+Y^2)<=D:
        sum=sum+1
print(sum)

Fixed submission:
import math
N, D = map(int, input().split())
sum=0
for i in range(0,N):
    X, Y = map(int, input().split())
    if pow(X,2)+pow(Y,2)<=pow(D,2):
        sum=sum+1
print(sum)
Buggy python submission (verdict: Runtime Error):
r=int(input())
print(powr,2)

Fixed submission:
r=int(input())
print(pow(r,2))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
for i in range(1,N):
    if N%i==0:
        A.append(i+N//i-2)
print(min(A))


Fixed submission:
import math
N=int(input())
x=N+1
for i in range(1,int(math.sqrt(N))+1):
    if N%i==0:
        x=min(x,i+N//i)
print(x-2)

Buggy python submission (verdict: Runtime Error):
import math
N=int(input())
A=[2*N]*N
for i in range(1,int(math.sqrt(N))):
    if N%i==0:
        A[i]=i+N//i-2
print(min(A))


Fixed submission:
import math
N=int(input())
x=N+1
for i in range(1,int(math.sqrt(N))+1):
    if N%i==0:
        x=min(x,i+N//i)
print(x-2)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[2*N]*N
for i in range(1,N//2):
    if N%i==0:
        A[i]=i+N//i-2
print(min(A))


Fixed submission:
import math
N=int(input())
x=N+1
for i in range(1,int(math.sqrt(N))+1):
    if N%i==0:
        x=min(x,i+N//i)
print(x-2)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A = list(map(int, input().split()))
C=[0]*N
for i in range(0,N):
    C[i]=A.index(i+1)+1
print(*C)

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

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A = list(map(int, input().split()))
C=[]
for i in range(0,N):
    C.append(A.index(i+1)+1)
print(*C)

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