Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
xy = [list(map(int, input().split())) for _ in range(n)]

MAX = 10**9
MIN = -1 * MAX
def check(x_r, x_l, y_t, y_b):
    tl = [MIN, MAX]
    br = [MAX, MIN]
    if x_r == x_l or y_t == y_b:
        return False, -1

    tl[0] = max(tl[0], xy[x_l][0])
    tl[1] = min(tl[1], xy[y_t][1])
    br[0] = min(br[0], xy[x_r][0])
    br[1] = max(br[1], xy[y_b][1])

    # count k
    cnt = 0
    for i in range(n):
        if tl[0] <= xy[i][0] <= br[0] and br[1] <= xy[i][1] <= tl[1]:
            cnt += 1
    if cnt < k:
        return False, -1
    area = (br[0] - tl[0]) * (tl[1] - br[1])
    return True, area

INF = 10**20
ans = INF
for a in range(n):
    for b in range(n):
        for c in range(n):
            for d in range(n):
                f, area = check(a, b, c, d)
                if f:
                    ans = min(ans, area)
print(ans)

Fixed submission:
n, k = map(int, input().split())
xy = [list(map(int, input().split())) for _ in range(n)]

MAX = 10**9
MIN = -1 * MAX
def check(x_r, x_l, y_t, y_b):
    tl = [MIN, MAX]
    br = [MAX, MIN]
    if x_r == x_l or y_t == y_b:
        return False, -1

    tl[0] = max(tl[0], xy[x_l][0])
    tl[1] = min(tl[1], xy[y_t][1])
    br[0] = min(br[0], xy[x_r][0])
    br[1] = max(br[1], xy[y_b][1])

    # count k
    cnt = 0
    for i in range(n):
        if tl[0] <= xy[i][0] <= br[0] and br[1] <= xy[i][1] <= tl[1]:
            cnt += 1
    if cnt < k:
        return False, -1
    area = (br[0] - tl[0]) * (tl[1] - br[1])
    return True, area

INF = 10**20
ans = INF
for a in range(n):
    for b in range(n):
        if a == b:
            continue
        if xy[a][0] < xy[b][0]:
            continue
        for c in range(n):
            for d in range(n):
                if c == d:
                    continue
                if xy[c][1] < xy[d][1]:
                    continue
                f, area = check(a, b, c, d)
                if f:
                    ans = min(ans, area)
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
n = int(input())

abc = []
edges = defaultdict(lambda: [])
for _ in range(n-1):
    a, b, c = map(int, input().split())
    edges[a].append([b, c])
    edges[b].append([a, c])

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

# k からの距離を求める
dist = [-1 for _ in range(n+1)]
is_checked = [False for _ in range(n+1)]
def dfs(num, cur_dist):
    for next_num, d in edges[num]:
        if not is_checked[next_num]:
            is_checked[next_num] = True
            dist[next_num] = cur_dist+d
            dfs(next_num, cur_dist+d)
dist[k] = 0
is_checked[k] = True
dfs(k, 0)
# print(dist)
ans = []
for _ in range(q):
    x, y = map(int, input().split())
    ans.append(str(dist[x] + dist[y]))
print("\n".join(ans))

Fixed submission:
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(20000000)
from collections import defaultdict
n = int(input())

abc = []
edges = defaultdict(lambda: [])
for _ in range(n-1):
    a, b, c = map(int, input().split())
    edges[a].append([b, c])
    edges[b].append([a, c])

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

# k からの距離を求める
dist = [-1 for _ in range(n+1)]
is_checked = [False for _ in range(n+1)]
def dfs(num, cur_dist):
    global dist, is_checked
    for next_num, d in edges[num]:
        if not is_checked[next_num]:
            is_checked[next_num] = True
            dist[next_num] = cur_dist + d
            dfs(next_num, cur_dist + d)
dist[k] = 0
is_checked[k] = True
dfs(k, 0)

ans = []
for _ in range(q):
    x, y = map(int, input().split())
    ans.append(str(dist[x] + dist[y]))
print("\n".join(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())

ans_s = s
ans_head = 0
ans_tail = 0

def remove(s):
    while True:
        if len(s) <= 0:
            break
        pre_len = len(s)
        s = s.replace("()", "")
        if len(s) == pre_len:
            break
    return s

while len(s) > 0:
    s = remove(s)
    if s[0] == ')':
        ans_head += 1
        s = remove('(' + s)
    else:
        ans_tail += 1
        s = remove(s + ')')
    # print(s)
print('('*ans_head + ans_s + ')' * ans_tail)



Fixed submission:
n = int(input())
s = str(input())

ans_s = s
ans_head = 0
ans_tail = 0

def remove(s):
    while True:
        if len(s) <= 0:
            break
        pre_len = len(s)
        s = s.replace("()", "")
        if len(s) == pre_len:
            break
    return s

s = remove(s)
while len(s) > 0:
    s = remove(s)
    if s[0] == ')':
        ans_head += 1
        s = remove('(' + s)
    else:
        ans_tail += 1
        s = remove(s + ')')
    # print(s)
print('('*ans_head + ans_s + ')' * ans_tail)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())

ans_s = s
ans_head = 0
ans_tail = 0

def remove(s):
    while True:
        pre_len = len(s)
        s = s.replace("()", "")
        if len(s) == pre_len:
            break
    return s

while len(s) > 0:
    s = remove(s)
    if s[0] == ')':
        ans_head += 1
        s = remove('(' + s)
    else:
        ans_tail += 1
        s = remove(s + ')')
    # print(s)
print('('*ans_head + ans_s + ')' * ans_tail)



Fixed submission:
n = int(input())
s = str(input())

ans_s = s
ans_head = 0
ans_tail = 0

def remove(s):
    while True:
        if len(s) <= 0:
            break
        pre_len = len(s)
        s = s.replace("()", "")
        if len(s) == pre_len:
            break
    return s

s = remove(s)
while len(s) > 0:
    s = remove(s)
    if s[0] == ')':
        ans_head += 1
        s = remove('(' + s)
    else:
        ans_tail += 1
        s = remove(s + ')')
    # print(s)
print('('*ans_head + ans_s + ')' * ans_tail)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
    s.append(list(str(input())))

alphabet = set(s[0])

for i in range(1, n):
    alphabet = alphabet & set(s[i])

count_min = {}
for a in sorted(alphabet):
    count_min[a] = min(count_min[a], s[0].count(a))

ans = ""

for k, v in sorted(count_min.items()):
    for i in range(v):
        ans += k
print(ans)

Fixed submission:
from collections import defaultdict

n = int(input())
s = []
for i in range(n):
    s.append(list(str(input())))

alphabet = set(s[0])

for i in range(1, n):
    alphabet = alphabet & set(s[i])

count_min = defaultdict(lambda: 10**9)
for a in sorted(alphabet):
    for i in range(n):
        count_min[a] = min(count_min[a], s[i].count(a))

ans = ""

for k, v in sorted(count_min.items()):
    for i in range(v):
        ans += k
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
    s.append(list(str(input())))

alphabet = set(s[0])

for i in range(1, n):
    alphabet = alphabet & set(s[i])

count_min = {}
for a in sorted(alphabet):
    count_min[a] = min(s[0].count(a))

ans = ""

for k, v in sorted(count_min.items()):
    for i in range(v):
        ans += k
print(ans)

Fixed submission:
from collections import defaultdict

n = int(input())
s = []
for i in range(n):
    s.append(list(str(input())))

alphabet = set(s[0])

for i in range(1, n):
    alphabet = alphabet & set(s[i])

count_min = defaultdict(lambda: 10**9)
for a in sorted(alphabet):
    for i in range(n):
        count_min[a] = min(count_min[a], s[i].count(a))

ans = ""

for k, v in sorted(count_min.items()):
    for i in range(v):
        ans += k
print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

a = []
b = []

for i in range(n):
    a.append(list(input()))
for i in range(m):
    b.append(list(input()))

for s_h in range(n - m):
    for s_w in range(n - m):
        flag = True
        for i in range(m):
            for j in range(m):
                if a[s_h + i][s_w + j] != b[i][j]:
                    flag = False
                    break
            if not flag:
                break
        if flag:
            print("Yes")
            break
    if flag:
        break
if not flag:
    print("No")

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

a = []
b = []

for i in range(n):
    a.append(list(input()))
for i in range(m):
    b.append(list(input()))



for s_h in range(n - m + 1):
    for s_w in range(n - m + 1):
        flag = True
        for i in range(m):
            for j in range(m):
                if a[s_h + i][s_w + j] != b[i][j]:
                    flag = False
                    break
            if not flag:
                break
        if flag:
            print("Yes")
            break
    if flag:
        break
if not flag:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

count = 0

for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x + y + z == s:
                count += 1

print(count)

Fixed submission:
k, s = map(int, input().split())
count = 0
for x in range(k+1):
    for y in range(k+1):
        if 0 <= s - (x + y) <= k:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)

f = 0
for i in range(s):
    if s[i] == 'C' and f == 0:
        f += 1
    if s[i] == 'F' and f == 1:
        print("Yes")
        exit()
print("No")


Fixed submission:
s = input()
n = len(s)

f = 0
for i in range(n):
    if s[i] == 'C' and f == 0:
        f += 1
    if s[i] == 'F' and f == 1:
        print("Yes")
        exit()
print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)

f = 0
for i in range(s):
    if s[i] == 'C' and f = 0:
        f += 1
    if s[i] == 'F' and f = 1:
        print("Yes")
        exit()
print("No")


Fixed submission:
s = input()
n = len(s)

f = 0
for i in range(n):
    if s[i] == 'C' and f == 0:
        f += 1
    if s[i] == 'F' and f == 1:
        print("Yes")
        exit()
print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ta = []
for i in range(n):
    t, a = map(int, input().split())
    ta.append([t, a])

t = ta[0][0]
a = ta[0][1]
for i in range(1, n):
    p = ta[i][0] / (ta[i][0] + ta[i][1])
    while True:
        if p == t / (t + a):
            break
        if p < t / (t + a):
            a += 1
        else:
            t += 1

print(t + a)


Fixed submission:
import math
from fractions import Fraction
N = int(input())

ta = [0] * N
ao = [0] * N

for i in range(N):
    t, a = map(int, input().split())
    if i == 0:
        ta[i] = t
        ao[i] = a
    else:
        tmp = max(math.ceil(Fraction(ta[i-1],t)), math.ceil(Fraction(ao[i-1],a)))
        ta[i] = t*tmp
        ao[i] = a*tmp

print(ta[-1]+ao[-1])
Buggy python submission (verdict: Runtime Error):
n, a = map(int, input().split())
x = list(map(int, input().split()))
x_max = max(x)
dp = [[[0 for _ in range(n*x_max+1)] for _ in range(n+1)] for _ in range(n+1)]

for i in range(n+1):
    for j in range(n+1):
        for k in range(n*x_max+1):
            if i == 0 and j == 0 and k == 0:
                dp[i][j][k] = 1
            elif i >= 1 and k < x[i-1]:
                dp[i][j][k] = dp[i-1][j][k]
            elif i >= 1 and j >= 1 and k >= x[i-1]:
                dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k - x[i-1]]
            else:
                dp[i][j][k] = 0
ans = 0
for k in range(n+1):
    ans += dp[n][k][k*a]
print(ans-1)

Fixed submission:
n, a = map(int, input().split())
x = list(map(int, input().split()))
x_max = max(x)
dp = [[[0 for _ in range(n*x_max+1)] for _ in range(n+1)] for _ in range(n+1)]

for i in range(n+1):
    for j in range(n+1):
        for k in range(n*x_max+1):
            if i == 0 and j == 0 and k == 0:
                dp[i][j][k] = 1
            elif i >= 1 and k < x[i-1]:
                dp[i][j][k] = dp[i-1][j][k]
            elif i >= 1 and j >= 1 and k >= x[i-1]:
                dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k - x[i-1]]
            else:
                dp[i][j][k] = 0
ans = 0
for k in range(1, n+1):
    if k * a <= n*x_max:
        ans += dp[n][k][k*a]
print(ans)
Buggy python submission (verdict: Runtime Error):
from math import ceil
n = int(input())
a = list(map(int, input().split()))

ans = 10**10

m1 = a[ceil(n/2)]
m2 = int(sum(a) / n)
m3 = ceil(sum(a) / n)

for v in [m1, m2, m3]:
    cost = 0
    for i in range(n):
        cost += (a[i] - v) ** 2
    ans = min(cost, ans)
print(ans)

Fixed submission:
from math import ceil
n = int(input())
a = list(map(int, input().split()))

ans = 10**10

m1 = a[int(n/2)]
m2 = int(sum(a) / n)
m3 = ceil(sum(a) / n)

for v in [m1, m2, m3]:
    cost = 0
    for i in range(n):
        cost += (a[i] - v) ** 2
    ans = min(cost, ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

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

c = 0

for i in range(N-1):
  for j in range(int(i)+1, N):
    d = A[i] % (10**9+7)
    e = A[j] % (10**9+7)
    f = (d*e) % (10**9+7)
    c += f
    

c = c % (10**9+7)

print(c)

Fixed submission:
d, t, s = map(int, input().split())

c = d / s

if t>=c:
  print('Yes')
elif t<c:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

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

c = 0

for i in range(N-1):
  for j in range(int(i)+1, N):
    d = A[i] % (10**9+7)
    e = A[j] % (10**9+7)
    f = (d*e) % (10**9+7)
    c += f
    

c = c % (10**9+7)

print(c)

Fixed submission:
N = int(input())

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

S = 0
for i in range(N):
  S += A[i]

c = S
d = 0
for j in range(N):
  c -= A[j]
  c = c%(10**9+7)
  d += A[j]*c
  d = d%(10**9+7)
  
print(d)

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

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

c = 0

for i in range(N-1):
  for j in range(int(i)+1, N):
    d = (A[i]*A[j]) % (10**9+7)
    c += d
    

c = c % (10**9+7)

print(c)

Fixed submission:
N = int(input())

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

S = 0
for i in range(N):
  S += A[i]

c = S
d = 0
for j in range(N):
  c -= A[j]
  c = c%(10**9+7)
  d += A[j]*c
  d = d%(10**9+7)
  
print(d)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input())
a = 0

if N < 10:
  a = 100*(10-N) + K
  print(a)
  
elif N >= 10:
  print(K)
  

Fixed submission:
N, K = map(int, input().split())
a = 0
 
if N < 10:
  a = 100*(10-N) + K
  print(a)
  
elif N >= 10:
  print(K)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())

if N <= K:
  print(0)
  
else:
  H = list(map(int, input().split()))
  H.sort()
  H.reverse()
  for i in range(K):
    del(H[0])
 
  c = 0
  for j in range(len(H)):
    c += H[j]
  print(c)

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

if N <= K:
  print(0)
  
else:
  H = list(map(int, input().split()))
  H.sort()
  H.reverse()
  
  c = 0
  for i in range(K, N):
    c += H[i]
  print(c)

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

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

H.sort()
H.reverse()


for i in range(K):
  del(H[0])
  
c = 0

for j in range(len(H)):
  c += H[j]

print(c)

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

if N <= K:
  print(0)
  
else:
  H = list(map(int, input().split()))
  H.sort()
  H.reverse()
  
  c = 0
  for i in range(K, N):
    c += H[i]
  print(c)
Buggy python submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
import math

S = a*b
s = x/a

if s >= S/2:
  em_s = S-s
  tan = (a**2)/(2*em_s)
  ans = math.degrees(math.atan(tan))
  print(90-ans)
else:
  tan = (2*s)/(b**2)
  ans = math.degrees(math.atan(tan))
  print(90-ans)

Fixed submission:
a, b, x = map(int, input().split())
import math

S = a*b
s = x/a
if s == S:
  print(0)

elif s >= S/2:
  em_s = S-s
  tan = (a**2)/(2*em_s)
  ans = math.degrees(math.atan(tan))
  print(90-ans)

else:
  tan = (2*s)/(b**2)
  ans = math.degrees(math.atan(tan))
  print(90-ans)
Buggy python submission (verdict: Runtime Error):
N, K, Q = map(int, input().split())

ans = [K]*N

for i in range(Q):
  A = int(input())
  
  
  for j in range(N):
    if j != (A-1):
      if ans[j] > 0:
        ans[j] -= 1
  

for i in range(N):
  if ans[i] <= 0:
    print('No')
  else:
    print('Yes')

Fixed submission:
S = input()

if S == 'Sunny':
  print('Cloudy')
elif S == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
Buggy python submission (verdict: Runtime Error):
n = int(input())

s = list(map(int, input().split()))
t = []
v = 0

for i in range(n):
  c = 1/s[i]
  t.append(c)
  
for j in range(n):
  v += t[j]
  
ans = 1/v

print(ans)

Fixed submission:
a = int(input())

s = input()

if a >= 3200:
  print(s)
else:
  print('red')
Buggy python submission (verdict: Runtime Error):
n, l = map(int, input().split())

s = n*(l-1) + n*(n+1)/2
c = s
j = 1

for i in range(n):
  t = s - ((l-1)-1)
  T = abs(s-t)
  if T < c:
    c = T
    j = i
    
e = l+j
print(int(s-e))
  




Fixed submission:
n = list(input())

if n[0] == n[1]:
  print("Bad")
  exit()
elif n[1] == n[2]:
  print("Bad")
  exit()
elif n[2] == n[3]:
  print("Bad")
  exit()
print('Good')
Buggy python submission (verdict: Runtime Error):
a = [int(input()) for i in range(3)]

if a[0] == 2:
  print(a[1] + a[2])
  
elif a[0] == 1:
  print('Hello World')


Fixed submission:
N = int(input())

if N == 1:
  print('Hello World')
  
elif N == 2:
  print(int(input()) + int(input()))

Buggy python submission (verdict: Runtime Error):
a = [int(input()) for i in range(3)]

if a[0] == 2:
  print(a[1] + a[2])
  
else:
  print('Hello World')

Fixed submission:
N = int(input())

if N == 1:
  print('Hello World')
  
elif N == 2:
  print(int(input()) + int(input()))

Buggy python submission (verdict: Runtime Error):
a = [int(input()) for i in range(3)]

N = a[0]
A = a[1]
B = a[2]

if N = 1:
  print("Hello World")
  
elif:
  print(A + B)

Fixed submission:
N = int(input())

if N == 1:
  print('Hello World')
  
elif N == 2:
  print(int(input()) + int(input()))
Buggy python submission (verdict: Time Limit Exceeded):
M=1000000007
s=0
n=int(input())
a=list(map(int,input().split()))
for i in range(n-1):
    for j in range(i+1,n):
        s+=(a[i]%M*a[j]%M)%M
print(s%M)
        
    

Fixed submission:
M=1000000007
def findProductSum(A, n): 
    s = 0
    for i in range(n): 
        s+=A[i] 
    array_sum_square = s*s
    individual_square_sum = 0
    for i in range(n): 
        individual_square_sum += A[i]*A[i]
    return (array_sum_square -individual_square_sum) // 2
n=int(input())
a=list(map(int,input().split()))
print(findProductSum(a,n)%M)

Buggy python submission (verdict: Time Limit Exceeded):
M=1000000007
s=0
n=int(input())
a=list(map(int,input().split()))
for i in range(n-1):
    for j in range(i+1,n):
        s+=(a[i]*a[j])
print(s%M)
        
    

Fixed submission:
M=1000000007
def findProductSum(A, n): 
    s = 0
    for i in range(n): 
        s+=A[i] 
    array_sum_square = s*s
    individual_square_sum = 0
    for i in range(n): 
        individual_square_sum += A[i]*A[i]
    return (array_sum_square -individual_square_sum) // 2
n=int(input())
a=list(map(int,input().split()))
print(findProductSum(a,n)%M)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=list(map(int,input().split())
p.sort()
print(sum(p[:k]))

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
print(sum(p[:k]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
2 ans = ''
3 while N > 0:
4 N -= 1
5 ans += chr(ord('a') + N % 26)
6 N //= 26
7 print(ans[::-1])

Fixed submission:
N = int(input())
ans = ''
while N > 0:
  N -= 1
  ans += chr(ord('a') + N % 26)
  N //= 26
print(ans[::-1])
Buggy python submission (verdict: Runtime Error):
x=input()
if x >=400 and 599<=x:
  print("8")
if x >=600 and 799<=x:
  print("7")
if x >=800 and 999<=x:
  print("6")
if x >=1000 and 1199<=x:
  print("5")
if x >=1200 and 1399<=x:
  print("4")
if x >=1400 and 1599<=x:
  print("3")
if x >=1600 and 1799<=x:
  print("2")
if x >=1800 
  print("1")
  

Fixed submission:
x=int(input())
if x >=400 and 599>=x:
  print("8")
if x >=600 and 799>=x:
  print("7")
if x >=800 and 999>=x:
  print("6")
if x >=1000 and 1199>=x:
  print("5")
if x >=1200 and 1399>=x:
  print("4")
if x >=1400 and 1599>=x:
  print("3")
if x >=1600 and 1799>=x:
  print("2")
if x >=1800:
  print("1")
Buggy python submission (verdict: Runtime Error):
N=input()
A=N%1000
print(A)

Fixed submission:
N=int(input())
A=N%1000
if A == 0:
    print(A)
    exit()
A=1000-A
print(A)
Buggy python submission (verdict: Runtime Error):
H,W,K=map(int,(input().split()))
board=[list(input().split()) for _ in range(H)]
ans=0
for paint_H in range(2**H):
    for paint_W in range(2**W):
        cnt=0
        for i in range(H):
            for j in range(W):
                if(paint_H>>i)&1==0 and (paint_W>>j)&1==0:
                    if board[i][j]=="#":
                        cnt+=1
        if cnt==K:
            ans+=1
print(ans)


Fixed submission:
H,W,K=map(int,(input().split()))
board=[list(input()) for _ in range(H)]
ans=0
for paint_H in range(2**H):
    for paint_W in range(2**W):
        cnt=0
        for i in range(H):
            for j in range(W):
                if(paint_H>>i)&1==0 and (paint_W>>j)&1==0:
                    if board[i][j]=="#":
                        cnt+=1
        if cnt==K:
            ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N=(int(input()))//10
if N==2 or N==4 or N==5 or N==7 or N==9:
  print("hon")
elif N==0 or N==1 or N==6 or N==8:
  print("pon")
else:
  print("bon")

Fixed submission:
x,y=map(int,input().split())
print(x*y)

Buggy python submission (verdict: Runtime Error):
x=int(input())
y=int(input())
print(x*y)

Fixed submission:
x,y=map(int,input().split())
print(x*y)
Buggy python submission (verdict: Runtime Error):
S,T=map(str,input().split())
S_list=list(S)
T_list=list(T)
count=0
for i in range(len(S)):
    if S[i]==T[i]:
        count+=1
if count==len(S_list):
    print("Yes")
else:
    print("No")

Fixed submission:
S=str(input())
T=str(input())
S_list=list(S)
T_list=list(T)
count=0
for i in range(len(S)):
    if S[i]==T[i]:
        count+=1
if count==len(S_list):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[]
count=0
for i in range(N):
    A=input()
    if A not in S:
        S.append(A)
        count+=1
print(count)

Fixed submission:
N=int(input())
S=[]
for i in range(N):
    A=input()
    S.append(A)
print(len(set(S)))

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=[]
count++
for i in range(N):
    A=input()
    if A not in S:
        S.append(A)
        count+=1
print(count)

Fixed submission:
N=int(input())
S=[]
for i in range(N):
    A=input()
    S.append(A)
print(len(set(S)))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[]
for i in range(N):
    A=input()
    if A not in S:
        S.append(A)
print(len(S))

Fixed submission:
N=int(input())
S=[]
for i in range(N):
    A=input()
    S.append(A)
print(len(set(S)))
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans=[0]*n
for i in A:
    ans[i-1]+=1
for j in ans:
    print(j)

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

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans=[]
for i in A:
    ans[i-1]+=1
for j in ans:
    print(j)

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

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    print(A.count(i))

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
ans=[0]*N
for i in A:
    ans[i-1]+=1
for j in ans:
    print(j)
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
while True:
    N1=abs(N-K)
    if N<N1:
        ans=N
        break
    else:
        N=N1
print(ans)

Fixed submission:
N,K=map(int,input().split())
x=N%K
y=abs(N%K-K)
if x<y:
    print(x)
else:
    print(y)