Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0,0,0,0]
for i in range(n):
  s = input()
  if s=="AC":
    a[0] += 1
  elif s=="WA":
    a[1] += 1
  elif s=="TLE":
    a[2] += 1
  elif :
    a[3] += 1
print("AC x ",end="")
print(a[0])
print("WA x ",end="")
print(a[1])
print("TLE x ",end="")
print(a[2])
print("RE x ",end="")
print(a[3])


Fixed submission:
n = int(input())
a = [0,0,0,0]
for i in range(n):
  s = input()
  if s=="AC":
    a[0] += 1
  elif s=="WA":
    a[1] += 1
  elif s=="TLE":
    a[2] += 1
  else:
    a[3] += 1
print("AC x ",end="")
print(a[0])
print("WA x ",end="")
print(a[1])
print("TLE x ",end="")
print(a[2])
print("RE x ",end="")
print(a[3])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0,0,0,0]
for i in range(n):
  if input()=="AC":
    a[0] += 1
  elif input()=="WA":
    a[1] += 1
  elif input()=="TLE":
    a[2] += 1
  else:
    a[3] += 1
print("AC x ",end="")
print(a[0])
print("WA x ",end="")
print(a[1])
print("TLE x ",end="")
print(a[2])
print("RE x ",end="")
print(a[3])

Fixed submission:
n = int(input())
a = [0,0,0,0]
for i in range(n):
  s = input()
  if s=="AC":
    a[0] += 1
  elif s=="WA":
    a[1] += 1
  elif s=="TLE":
    a[2] += 1
  else:
    a[3] += 1
print("AC x ",end="")
print(a[0])
print("WA x ",end="")
print(a[1])
print("TLE x ",end="")
print(a[2])
print("RE x ",end="")
print(a[3])
Buggy python submission (verdict: Runtime Error):
primes = [2]
li = [[],[]]
f_ans = [0]
def f(x):
  if x==1:
    f_ans.append(1)
    return 1
  if x==2:
    f_ans.append(2)
    return 2
  flag = True
  for i in range(len(primes)):
    if x%primes[i]==0:
      tmp = li[x//primes[i]][:]
      tmp[i] += 1
      li.append(tmp)
      f_ans.append(f_ans[x//primes[i]]//tmp[i]*(tmp[i]+1))
      return f_ans(x)
    else:
      li.append([0]*len(primes)+[1])
      f_ans.append(2)
      primes.append(x)
      return 2

n = int(input())
sum = 0
for i in range(1,n+1):
  sum += i * f(i)
print(sum)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n+1):
  ans += i * (1+n//i) * (n//i) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
primes = [2]

def f(x):
  if x==1:
    return 1
  a = []
  ret = 1
  for i in primes:
    cnt = 0
    while x%i==0:
      x //= i
      cnt += 1
    if cnt!=0:
      a.append(cnt)
  if len(a)==0:
    primes.append(x)
    ret = 2
  else:
    for i in a:
      ret *= i+1
  return ret

n = int(input())
sum = 0
for i in range(1,n+1):
  sum += i * f(i)
print(sum)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n+1):
  ans += i * (1+n//i) * (n//i) // 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x,n = input().split()
x,n = int(x),int(n)

a = input().split()
for i in range(len(a)):
  a[i] = int(a[i])

if x not in a:
  print(x)
else:
  sa = 1
  while True:
    if x-sa not in a:
      print(x-sa)
      break
    if x+sa not in a:
      print(x+sa)
      break

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

a = input().split()
for i in range(len(a)):
  a[i] = int(a[i])

if x not in a:
  print(x)
else:
  sa = 1
  while True:
    if x-sa not in a:
      print(x-sa)
      break
    if x+sa not in a:
      print(x+sa)
      break
    sa += 1
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 1
s = input()
a = [int(x.strip()) for x in s.split(' ')]
if 0 in a:
  print(0)
  return
for i in range(n):
  ans *= a[i]
  if ans>1000000000000000000:
    print(-1)
    return
print ans

Fixed submission:
import sys
n = int(input())
ans = 1
s = input()
a = [int(x.strip()) for x in s.split(' ')]
if 0 in a:
  print(0)
  sys.exit()
for i in range(n):
  ans *= a[i]
  if ans>1000000000000000000:
    print(-1)
    sys.exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <stack>
#define _GLIBCXX_DEBUG
using namespace std;

int main()
{
    int n;
    cin >> n;
    long long a = 1, b = 1, c = 1;
    for (int i = 0; i < n; i++)
    {
        a *= 10;
        a %= 1000000007;
        b *= 9;
        b %= 1000000007;
        c *= 8;
        c %= 1000000007;
    }
    cout << (a-b-b+c+1000000007)%1000000007 << endl;
}

Fixed submission:
n = int(input())
ans = 10**n-2*9**n+8**n
print(ans%1000000007)
Buggy python submission (verdict: Runtime Error):
import math

n,x,t = map(int, input().split())
print(math.ceil(n/x)*t)import math

Fixed submission:
import math

n,x,t = map(int, input().split())
print(math.ceil(n/x)*t)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [input() for _ in range(n)]
a,b,c,d = int()
for x in range(n):
    if A[x] == "AC":
        a = a+1
    elif A[x] == "WA":
        b = b+1
    elif A[x] == "TLE":
        c = c+1
    elif A[x] == "RE":
        d = d+1
print("AC x",a)
print("WA x",b)
print("TLE x",c)
print("RE x",d)


Fixed submission:
n = int(input())
A = [input() for _ in range(n)]
a = int()
b = int()
c = int()
d = int()
for x in range(n):
    if A[x] == "AC":
        a = a+1
    elif A[x] == "WA":
        b = b+1
    elif A[x] == "TLE":
        c = c+1
    elif A[x] == "RE":
        d = d+1
print("AC x",a)
print("WA x",b)
print("TLE x",c)
print("RE x",d)
Buggy python submission (verdict: Runtime Error):
def main():
    import itertools
    a = tuple(map(int,input().split()))
    b = tuple(map(int,input().split()))
    c = tuple(map(int,input().split()))
    d = (a[0],b[0],c[0])
    e = (a[1],b[1],c[1])
    f = (a[2],b[2],c[2])
    g = (a[0],b[1],c[2])
    h = (a[2],b[1],c[0])
    A = set(a)
    B = set(b)
    C = set(c)
    D = set(d)
    E = set(e)
    F = set(f)
    G = set(g)
    H = set(h)
    n = int(input())
    listB = [int(input()) for x in range(n)]
    X = itertools.combinations(listB,3)
    R = set(list(X))
    if A in R or B in R or C in R or D in R or E in R or F in R or G in R or H in R:
      print("Yes")
    else:
      print("No")
main()

Fixed submission:
def main():
    N = int(input())
    if N%2 == 1:
      print(int((N+1)/2))
    else:
      print(int(N/2))
main()

Buggy python submission (verdict: Runtime Error):
def main():
    import itertools
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    c = list(map(int,input().split()))
    d = [a[0],b[0],c[0]]
    e = [a[1],b[1],c[1]]
    f = [a[2],b[2],c[2]]
    g = [a[0],b[1],c[2]]
    h = [a[2],b[1],c[0]]
    n = int(input())
    listB = [int(input()) for x in range(n)]
    C = itertools.combinations(listB,3)
    if a in C or b in C or c in C or d in C or e in C or f in C or g in C or h in C:
      print("Yes")
    else:
      print("No")
main()

Fixed submission:
def main():
    N = int(input())
    if N%2 == 1:
      print(int((N+1)/2))
    else:
      print(int(N/2))
main()

Buggy python submission (verdict: Runtime Error):
def main():
	N = int(input())
  	if N%2 == 1:
      print((N+1)/2)
    else:
      print(N/2)
main()

Fixed submission:
def main():
    N = int(input())
    if N%2 == 1:
      print(int((N+1)/2))
    else:
      print(int(N/2))
main()

Buggy python submission (verdict: Runtime Error):
def main()
	N = int(input())
  	if N%2 == 1:
      print((N+1)/2)
    else:
      print(N/2)
main()

Fixed submission:
def main():
    N = int(input())
    if N%2 == 1:
      print(int((N+1)/2))
    else:
      print(int(N/2))
main()

Buggy python submission (verdict: Runtime Error):
def main()
	a = int(input())
  	if a%2 == 1:
      print((a+1)/2)
    else:
      print(a/2)
main()

Fixed submission:
def main():
    N = int(input())
    if N%2 == 1:
      print(int((N+1)/2))
    else:
      print(int(N/2))
main()
Buggy python submission (verdict: Runtime Error):
def main():
    S = str(input())
    T = str(input())
    a = int(0)
    for x in range(len(S)):
      if S[x]!=T[x]:
          a = a + 1
    print(int(a))
main()

Fixed submission:
def main():
    import itertools
    a = tuple(map(int,input().split()))
    b = tuple(map(int,input().split()))
    c = tuple(map(int,input().split()))
    d = (a[0],b[0],c[0])
    e = (a[1],b[1],c[1])
    f = (a[2],b[2],c[2])
    g = (a[0],b[1],c[2])
    h = (a[2],b[1],c[0])
    n = int(input())
    listB = [int(input()) for x in range(n)]
    X = itertools.permutations(listB,3)
    R = list(X)
    if a in R or b in R or c in R or d in R or e in R or f in R or g in R or h in R:
      print("Yes")
    else:
      print("No")
main()

Buggy python submission (verdict: Runtime Error):
def main():
    import math
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    c = list(map(int,input().split()))
    d = [a[0],b[0],c[0]]
    e = [a[1],b[1],c[1]]
    f = [a[2],b[2],c[2]]
    g = [a[0],b[1],c[2]]
    h = [a[2],b[1],c[0]]
    n = int(input())
    listB = [int(input()) for x in range(n)]
    C = itertools.combinations(listB,3)
    if a in C or b in C or c in C or d in C or e in C or f in C or g in C or h in C:
      print("Yes")
    else:
      print("No")
main()

Fixed submission:
def main():
    import itertools
    a = tuple(map(int,input().split()))
    b = tuple(map(int,input().split()))
    c = tuple(map(int,input().split()))
    d = (a[0],b[0],c[0])
    e = (a[1],b[1],c[1])
    f = (a[2],b[2],c[2])
    g = (a[0],b[1],c[2])
    h = (a[2],b[1],c[0])
    n = int(input())
    listB = [int(input()) for x in range(n)]
    X = itertools.permutations(listB,3)
    R = list(X)
    if a in R or b in R or c in R or d in R or e in R or f in R or g in R or h in R:
      print("Yes")
    else:
      print("No")
main()
Buggy python submission (verdict: Runtime Error):
a,p = map(int, input().spilit())
print((3*a+p)/2-(3*a+p%2))


Fixed submission:
a,p = map(int, input().split())
print(int(((3*a+p)-(3*a+p)%2)/2))
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())
count = 0
if 3*k < s:
  print(0)
else:
  for i in range(0,k+1,1):
    for j in range(0,k+1,1):
      for k in range(0,k+1,1):
        if i+j+k == s:
          count = count+1
print(count)

Fixed submission:
k,s = map(int, input().split())
count = 0
for i in range(0,k+1,1):
  for j in range(0,k+1,1):
    if 0 <= s-i-j <= k:
      count = count+1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())
count = 0
for i in range(0,k+1,1):
  if i > s:
    break
  for j in range(0,k+1,1):
    if j > s:
      break
    for k in range(0,k+1,1):
      if k > s:
        break
      if i+j+k == s:
        count = count+1
print(count)

Fixed submission:
k,s = map(int, input().split())
count = 0
for i in range(0,k+1,1):
  for j in range(0,k+1,1):
    if 0 <= s-i-j <= k:
      count = count+1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())
count = 0
for i in range(0,k+1,1):
  for j in range(0,k+1,1):
    for k in range(0,k+1,1):
      if i+j+k == s:
        count = count+1
print(count)

Fixed submission:
k,s = map(int, input().split())
count = 0
for i in range(0,k+1,1):
  for j in range(0,k+1,1):
    if 0 <= s-i-j <= k:
      count = count+1
print(count)
Buggy python submission (verdict: Runtime Error):
if input()islower():
    print("a")
else:
    print("A")

Fixed submission:
if input().islower():
    print("a")
else:
    print("A")
Buggy python submission (verdict: Runtime Error):
import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, m = [int(i) for i in input().split()]
print(combinations_count(n,2)+combinations_count(m,2))

Fixed submission:
import math

def combinations_count(n, r):
    if n<r:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, m = [int(i) for i in input().split()]
print(combinations_count(n,2)+combinations_count(m,2))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]

ses = list(set(s))
setnums = []
for i in ses:
    setnums.append(s.count(i))

num = max(setnums)
pl = []
for i in ses:
    if num == s.count(i):
        pl.append(i)

pl = sorted(pl)
for i in pl:
    print(i)

Fixed submission:
import collections


n = int(input())
s = [input() for i in range(n)]
c = collections.Counter(s)

sss = set(s)
mx = 0
pl = []
for ss in sss:
    if c[ss] > mx:
        mx = c[ss]
        pl = [ss]
    elif c[ss] == mx:
        pl.append(ss)
pl = sorted(pl)
for i in pl:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]
count = 0
for i in range(n):
    if p[i] <= (min(p[0:i]) if i != 0 else p[0]):
        count += 1
print(count)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
min = n+1
count = 0
for i in range(n):
    if min >= p[i]+1:
        count += 1
        min = p[i]+1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]
count = 0
for i in range(n):
    if p[i] <= (min(p[0:i]) if i != 0 else p[0]):
        count += 1
print(count)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
min = n+1
count = 0
for i in range(n):
    if min >= p[i]+1:
        count += 1
        min = p[i]+1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]
count = 0
for i in range(n):
    flg = True
    for j in range(i):
        if not p[i] <= p[j]:
            flg = False
    count += flg
print(count)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
min = n+1
count = 0
for i in range(n):
    if min >= p[i]+1:
        count += 1
        min = p[i]+1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = [int(i) for i in input().split()]
for i in range(K):
    if A:
        A -= 1
    elif B:
        B -= 1
print(A, B)

Fixed submission:
A, B, K = [int(i) for i in input().split()]
if K > A:
    K -= A
    A = 0
    if K > B:
        print(0, 0)
    else:
        print(A, B-K)
else:
    print(A-K, B)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [int(i) for i in input().split()]
sum = 0
i = 0
while i < n:
    j = i+1
    while j <= n:
        sum += l[i] * l[j]
        j += 1
    i += 1
print(sum)

Fixed submission:
n = int(input())
l = [int(i) for i in input().split()]
sum = 0
i = 0
while i < n-1:
    j = i+1
    while j < n:
        sum += l[i] * l[j]
        j += 1
    i += 1
print(sum)
Buggy python submission (verdict: Runtime Error):
import sys
def input():
    return sys.stdin.readline()[:-1]


N, M = [int(i) for i in input().split()]
A = sorted([int(i) for i in input().split()])
for i in range(M):
    A[-1] = A[-1]//2
    A = sorted(A)
print(sum(A))

Fixed submission:
s = input()
if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
Buggy python submission (verdict: Runtime Error):
A, B, T = map(int, input().split())
T += 0.5
print(int(T/A*B)


Fixed submission:
A, B, T = map(int, input().split())
T += 0.5
print(int(T//A*B))
Buggy python submission (verdict: Runtime Error):
column = list(map(int, input().split(" ")))
N, D = column[0], column[1]
count = 0
for i in range(1, N+1):
  X, Y=column[2*i], column[2*i+1]
  if X^2 + Y^2 <= D^2:
    count += 1
print(count)

Fixed submission:
X =int(input())
if X >= 30:
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
x, y = [list(i) for i in zip(*xy)]
N, D = x[0], y[0]
count = 0
for i in range(1, N+1):
	X, Y=x[i], y[i]
    if X^2+Y^2 <= D^2:
    	count += 1
    else:
    	pass
print(count)


Fixed submission:
X =int(input())
if X >= 30:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
c = input()
if c == a or c == i or c == u or c == e or c == o:
  print('vowel')
else:
  print('consonant')

Fixed submission:
c = input()
if c == 'a' or c == 'i' or c == 'u' or c == 'e' or c == 'o':
  print('vowel')
else:
  print('consonant')
Buggy python submission (verdict: Runtime Error):
S = input()
strs = list(reversed(S))
rev_S = ''.join(strs)
while True:
  if rev_S[:6] == 'resare'
    rev_S = rev_S[6:]
    continue
  elif rev_S[:7] == 'remaerd':
    rev_S = rev_S[7:]
    continue
  elif rev_S[:5] == 'esare' or rev_S[:5] == 'maerd':
    rev_S = rev_S[5:]
    continue
  else:
    break

if rev_S == '':
  print('YES')
else:
  print('NO')

Fixed submission:
S = input()
strs = list(reversed(S))
rev_S = ''.join(strs)
while True:
  if rev_S[:6] == 'resare':
    rev_S = rev_S[6:]
    continue
  elif rev_S[:7] == 'remaerd':
    rev_S = rev_S[7:]
    continue
  elif rev_S[:5] == 'esare' or rev_S[:5] == 'maerd':
    rev_S = rev_S[5:]
    continue
  else:
    break

if rev_S == '':
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = tuple(map(int,input().split())) 
N = list(map(int,input().split()))
m = 0
for i in range(0,n-k+1):
    if m < sum(N[i:i+k]):
        m = sum(N[i:i+k])
print((m+k)/2)

Fixed submission:
n,k = tuple(map(int,input().split())) 
N = list(map(int,input().split()))
s = sum(N[0:k])
m = sum(N[0:k])

for i in range(0,n-k):
    s = s-N[i]+N[i+k]
    m = max(m,s)   
print((m+k)/2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
print(sum(range(1,N)))

Fixed submission:
N = int(input())
print(N*(N-1)//2)

Buggy python submission (verdict: Runtime Error):
 N = int(input())
 print(sum(range(1,N)))

Fixed submission:
N = int(input())
print(N*(N-1)//2)

Buggy python submission (verdict: Runtime Error):
N = int(split())
print(sum(range(1,N)))

Fixed submission:
N = int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b && b==c:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c=map(int,input().split())
if a==b & b==c:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
D = int(input())
D -= 25
print 'Christmas',end=''
while D<0:
    print 'Eve',end=''
    D += 1

Fixed submission:
D = int(input())
D -= 25
print('Christmas',end='')
while D<0:
    print(' Eve',end='')
    D += 1
Buggy python submission (verdict: Time Limit Exceeded):

def gcd(a, b):
    if(a < b):
        a, b = b, a
    if(b == 0):
        return a
    return gcd(b, a % b)

def lcm(a, b):
    return a // gcd(a, b) * b

N = int(input())
A = list(map(int, input().split()))
l = A[0]
for a in A:
    l = lcm(l, a)
ans = 0
mod = 10**9+7
for a in A:
    ans += (l * pow(a, mod-2, mod))%mod
    ans %= mod
print(ans)


Fixed submission:

def gcd(a, b):
    if(a < b):
        a, b = b, a
    if(b == 0):
        return a
    return gcd(b, a % b)

def lcm(a, b):
    return a // gcd(a, b) * b

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    l = A[0]
    for a in A:
        l = lcm(l, a)
    ans = 0
    mod = int(1e9+7)
    for a in A:
        ans += (l * pow(a, mod-2, mod))%mod
        ans %= mod
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

def gcd(a, b):
    if(a < b):
        a, b = b, a
    if(b == 0):
        return a
    return gcd(b, a % b)

def lcm(a, b):
    return a // gcd(a, b) * b

N = int(input())
A = list(map(int, input().split()))
l = A[0]
for a in A:
    l = lcm(l, a)
ans = 0
mod = int(1e9+7)
for a in A:
    ans += (l * pow(a, mod-2, mod))%mod
    ans %= mod
print(ans)


Fixed submission:

def gcd(a, b):
    if(a < b):
        a, b = b, a
    if(b == 0):
        return a
    return gcd(b, a % b)

def lcm(a, b):
    return a // gcd(a, b) * b

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    l = A[0]
    for a in A:
        l = lcm(l, a)
    ans = 0
    mod = int(1e9+7)
    for a in A:
        ans += (l * pow(a, mod-2, mod))%mod
        ans %= mod
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

def gcd(a, b):
    if(a < b):
        a, b = b, a
    if(b == 0):
        return a
    return gcd(b, a % b)

def lcm(a, b):
    return a // gcd(a, b) * b

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    l = A[0]
    for a in A:
        l = lcm(l, a)
    ans = 0
    mod = int(1e9+7)
    for a in A:
        ans += (l * pow(a, mod-2, mod))%mod
        ans %= mod
    print(ans)


Fixed submission:

def gcd(a, b):
    if(a < b):
        a, b = b, a
    if(b == 0):
        return a
    return gcd(b, a % b)

def lcm(a, b):
    return a // gcd(a, b) * b

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    l = A[0]
    for a in A:
        l = lcm(l, a)
    ans = 0
    mod = int(1e9+7)
    for a in A:
        ans += (l * pow(a, mod-2, mod))%mod
        ans %= mod
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def dist(i,j,x,y):
    a = abs(i-j)
    b = abs(x-i) + abs(y-j) + 1
    c = abs(x-j) + abs(y-i) + 1
    return min(a,b,c)

def main():
    N,X,Y = list(map(int,input().split()))

    X -= 1
    Y -= 1
    K = [0 for i in range(N+1)]

    for i in range(N):
        for j in range(N):
            index = dist(i,j,X,Y)
            K[index] += 1

    for i in range(1,N):
        print(int(K[i] / 2))
    

if __name__ == "__main__":
    main()
    


Fixed submission:
def dist(i,j,x,y):
    a = abs(i-j)
    b = abs(x-i) + abs(y-j) + 1
    c = abs(x-j) + abs(y-i) + 1
    return min(a,b,c)

def main():
    N,X,Y = list(map(int,input().split()))

    X -= 1
    Y -= 1
    K = [0 for i in range(N+1)]

    for i in range(N):
        for j in range(N):
            index = dist(i,j,X,Y)
            K[index] += 1

    for i in range(1,N):
        print(int(K[i] / 2))
    

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
N,W = map(int,input().split())
table = [ list(map(int,input().split(" "))) for i in range(N)]
N += 1
W += 1
dp = [[0 for i in range(W)] for j in range(N)]

for i in range(1,N):
    for j in range(W):
        if(j- table[i-1][0] >= 0):
            dp[i][j] = max(dp[i-1][j],dp[i-1][j-table[i-1][0]]+table[i-1][1])
        else:
            dp[i][j] = dp[i-1][j]


print(dp[N-1][W-1])


Fixed submission:
N,W = map(int,input().split())
table = [ list(map(int,input().split(" "))) for i in range(N)]
N += 1
W += 1
dp = [[0 for i in range(W)] for j in range(N)]

for i in range(1,N):
    for j in range(W):
        if(j- table[i-1][0] >= 0):
            dp[i][j] = max(dp[i-1][j],dp[i-1][j-table[i-1][0]]+table[i-1][1])
        else:
            dp[i][j] = dp[i-1][j]


print(dp[N-1][W-1])
Buggy python submission (verdict: Runtime Error):
import math
def main():
    s = str(input())
    t = str(input())
    u = int(s+t)
    if(math.sqrt(u) ** 2 - u):
        print("No")
    else:
        print("Yes")
main()

Fixed submission:
a,b = input().split()
c = a+b
c = int(c)
import math
if(int(math.sqrt(c)) ** 2 == c):
    print('Yes')
else:
    print('No')