Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, C = map(int, input().split())
X = {}
V = {}
for i in range(1, N+1):
    X[i], V[i] = map(int, input().split())
    
x = np.zeros([N, 6])
for i in range(N):
    x[i, 0] = X[i+1]
    x[i, 1] = V[i+1]
    
    x[i, 2] = min(x[i, 0], abs(C-x[i, 0]))
x[:, 4] = x[:, 1] - x[:, 2]
x[x[:, 0] == x[:, 2], 3] = 1
tmp = 0


result = 0
while max(x[x[:, 5]==0, 4]) > 0:
    max_arg_i = np.argmax(x[:, 4])
    now_best = x[max_arg_i]
    get_flag = np.logical_and(np.logical_and(x[:, 2] <= now_best[2], x[:, 3] == now_best[3]), x[:, 5] == 0)
    temp_get_cal = sum(x[get_flag, 1]) - now_best[2]
    x[get_flag, 5] = 1
    result += temp_get_cal
    x[:, 0] = abs(x[:, 0] - now_best[0])
    x[get_flag, 1] = 0
    for i in range(N):
        x[i, 2] = min(x[i, 0], abs(C-x[i, 0]))
    x[:, 4] = x[:, 1] - x[:, 2]
    x[x[:, 0] == x[:, 2], 3] = 1
print(int(result))

Fixed submission:
N, C = map(int, input().split())
X = {}
V = {}
for i in range(N):
    X[i], V[i] = map(int, input().split())

left, right = [], []
left.append(V[0] - X[0])
right.append(V[N-1] - (C - X[N-1]))
for i in range(1, N):
    left.append(left[i-1] + V[i] - X[i] + X[i-1])
    right.append(right[i-1] + V[N-i-1] - (C - X[N-i-1]) + (C - X[N-i]))

left_max = [0]
for i in range(N):
    if left[i] > left_max[i]:
        left_max.append(left[i])
    else:
        left_max.append(left_max[i])
right_max = [0]
for i in range(N):
    if right[i] > right_max[i]:
        right_max.append(right[i])
    else:
        right_max.append(right_max[i])
result = set()
for i in range(N):
    result.add(left[i]-X[i]+right_max[N-1-i])
for i in range(N):
    result.add(right[i]-(C - X[N-i-1])+left_max[N-1-i])
result = max(max(left_max), max(right_max), max(result))
print(result)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a_n = list(map(int, input().split()))
def UF(num):
    if num==0:
        return 1
    else:
        return num*UF(num-1)
def comb(a1, a2):
    return UF(a1)/(UF(a2)*UF(a1-a2))
result = np.zeros([n, n])
for i in range(n):
    for ii in range(n):
        if a_n[i] > a_n[ii]:
            result[i, ii] = comb(a_n[i], a_n[ii])
a = np.argmax(result)
res1 = a//n
res2 = a%n

print(a_n[res1], a_n[res2])

Fixed submission:
n = int(input())
a_n = list(map(int, input().split()))
result1 = max(a_n)
min_delta = max(a_n)
result2 = max(a_n)
for num in a_n:
    if num == result1:
        pass
    elif abs(num-result1/2)<=min_delta:
        min_delta = abs(num-result1/2)
        result2 = num
print('{} {}'.format(result1, result2))

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a_n = list(map(int, input().split()))
def UF(num):
    if num==1:
        return 1
    else:
        return num*UF(num-1)
def comb(a1, a2):
    return UF(a1)/(UF(a2)*UF(a1-a2))
result = np.zeros([n, n])
for i in range(n):
    for ii in range(n):
        if a_n[i] > a_n[ii]:
            result[i, ii] = comb(a_n[i], a_n[ii])
a = np.argmax(result)
res1 = a//n
res2 = a%n

print(a_n[res1], a_n[res2])

Fixed submission:
n = int(input())
a_n = list(map(int, input().split()))
result1 = max(a_n)
min_delta = max(a_n)
result2 = max(a_n)
for num in a_n:
    if num == result1:
        pass
    elif abs(num-result1/2)<=min_delta:
        min_delta = abs(num-result1/2)
        result2 = num
print('{} {}'.format(result1, result2))
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
X = int(input())
res = 0
for i_a in range(0, A+1):
    for i_b in range(0, B+1):
        for i_c in range(0, C+1):
            money = 500 * i_a + 100 * i_b + 50 * i_c
            if money == X:
                res += 1
print(res)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())

X = int(input())
res = 0
for i_a in range(0, A+1):
    for i_b in range(0, B+1):
        for i_c in range(0, C+1):
            money = 500 * i_a + 100 * i_b + 50 * i_c
            if money == X:
                res += 1
print(res)
Buggy python submission (verdict: Runtime Error):

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

lsum = a+b
rsum = c+d


if lsum<rsum:
    print('Right')
elif lsum==rsum:
    print('Balanced)
else:
    print('Left')


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

lsum = a+b
rsum = c+d


if lsum<rsum:
    print('Right')
elif lsum==rsum:
    print('Balanced')
else:
    print('Left')
Buggy python submission (verdict: Runtime Error):
x = input()

keta = len(str(x))

f = []
for i in range(keta):
    f.append(int(str(x)[i]))
f = sum(f)

if x%f == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
x = int(input())

keta = len(str(x))

f = []
for i in range(keta):
    f.append(int(str(x)[i]))
f = sum(f)

if x%f == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
s = input()
n_s = len(s)
S = ''
for i in range(n_s):
    S += s[-i-1]
words = ["maerd", "remaerd", "esare", "resare"]
cnt = 0
result = 'Yes'
while True:
    if S[cnt:cnt+5] == 'maerd':
        cnt += 5
    elif S[cnt:cnt+5] == 'esare':
        cnt += 5
    elif S[cnt:cnt+6] == 'resare':
        cnt += 6
    elif S[cnt:cnt+7] == 'remaerd':
        cnt += 7
    else:
        result = 'No'
        break
    if cnt == n_S:
        break
print(result)

Fixed submission:
s = input()
n_s = len(s)
S = ''
for i in range(n_s):
    S += s[-i-1]
words = ["maerd", "remaerd", "esare", "resare"]
cnt = 0
result = 'YES'
while True:
    if S[cnt:cnt+5] == 'maerd':
        cnt += 5
    elif S[cnt:cnt+5] == 'esare':
        cnt += 5
    elif S[cnt:cnt+6] == 'resare':
        cnt += 6
    elif S[cnt:cnt+7] == 'remaerd':
        cnt += 7
    else:
        result = 'NO'
        break
    if cnt == n_s:
        break
print(result)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

def inside(x, y):    
    return 0 <= x <= h - 3 and 0 <= y <= w - 3

h, w, n = (int(_) for _ in input().split())
black = defaultdict(int)
for i in range(n):
    a, b = (int(_) - 1 for _ in input().split())
    for j in range(3):
        for k in range(3):
            x, y = a - j, b - k
            if not inside(x, y):
                continue
            black[(x, y)] += 1
ans = [0 for i in range(10)]
ans[0] = (h-2)*(w-2) - len(black)
for k in black:
    ans[black[k]] += 1
for i in range(10):
    print(ans[i])


Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a + b) * h // 2)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict

def inside(x, y):    
    return 0 <= x <= h - 3 and 0 <= y <= w - 3

h, w, n = (int(_) for _ in input().split())
black = defaultdict(int)
for i in range(n):
    a, b = (int(_) - 1 for _ in input().split())
    for j in range(3):
        for k in range(3):
            x, y = a - j, b - k
            if not inside(x, y):
                continue
            black[(x, y)] += 1
ans = [0 for i in range(10)]
ans[0] = (h-2)*(w-2) - len(black)
for k in black:
    ans[black[k]] += 1
for i in range(10):
    print(ans[i])

            
    


Fixed submission:
from collections import defaultdict

def inside(x, y):    
    return 0 <= x <= h - 3 and 0 <= y <= w - 3

h, w, n = (int(_) for _ in input().split())
black = defaultdict(int)
for i in range(n):
    a, b = (int(_) - 1 for _ in input().split())
    for j in range(3):
        for k in range(3):
            x, y = a - j, b - k
            if not inside(x, y):
                continue
            black[(x, y)] += 1
ans = [0 for i in range(10)]
ans[0] = (h-2)*(w-2) - len(black)
for k in black:
    ans[black[k]] += 1
for i in range(10):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())

if(abs(c-a)<d*2):
    print("Yes")
else:
    print("No")

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

if(abs(repo[2]-repo[0])<repo[3]*2):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())
l = []
for i in range(1,k):
    for j in range(len(s)-i+1):
        l.append(s[j:j+i])


l = list(set(l))
l.sort()
print(l[k-1])

Fixed submission:
s = input()
k = int(input())
l = []
for i in range(1,k+1):
    for j in range(len(s)-i+1):
        l.append(s[j:j+i])


l = list(set(l))
l.sort()
print(l[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())
l = []
for i in range(1,len(s)+1):
    for j in range(len(s)-i+1):
        l.append(s[j:j+i])


l = list(set(l))
l.sort()
print(l[k-1])

Fixed submission:
s = input()
k = int(input())
l = []
for i in range(1,k+1):
    for j in range(len(s)-i+1):
        l.append(s[j:j+i])


l = list(set(l))
l.sort()
print(l[k-1])
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 17 14:45:17 2018

@author: kitamura
"""

N = int(input())
X = list(map(int, input().split()))

for i in range(N):
    M=[]
    for j in range(N):
        if j==i:
            continue
        M.append(X[j])
    M.sort()
#    print(M)
    print(M[(int(N/2))-1])
    
    

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

if a<=x<=a+b:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
"""
TODO
"""


def substring(s):
    ss = []
    max_ss = len(s) + 1
    for ss_len in range(1, max_ss):
        max_ofs = max_ss - ss_len
        for ofs in range(0, max_ofs):
            c = s[ofs:ss_len + ofs]
            ss.append(c)
    ss = list(set(ss))
    return sorted(ss)


def nth_largest(s, n):
    ss = substring(s)
    return ss[n - 1]


if __name__ == "__main__":
    s = input().rstrip()
    K = int(input().rstrip())
    print(nth_largest(s, K))


Fixed submission:
"""
TODO
"""


def talkable(a, b, c, d):
    if abs(a - c) <= d:
        return True

    if abs(a - b) <= d:
        if abs(b - c) <= d:
            return True

    return False


if __name__ == "__main__":
    a, b, c, d = map(int, input().rstrip().split(' '))
    if talkable(a, b, c, d):
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
"""
TODO
"""
import sys


def substring(s):
    ss = []
    max_ss = len(s) + 1
    for ss_len in range(1, max_ss):
        max_ofs = max_ss - ss_len
        for ofs in range(0, max_ofs):
            c = s[ofs:ss_len + ofs]
            ss.append(c)
    ss = list(set(ss))
    return sorted(ss)


def nth_largest(s, n):
    ss = substring(s)
    return ss[n - 1]


if __name__ == "__main__":
    s = input().rstrip()
    K = int(input().rstrip())
    print(nth_largest(s, K))


Fixed submission:
"""
TODO
"""


def talkable(a, b, c, d):
    if abs(a - c) <= d:
        return True

    if abs(a - b) <= d:
        if abs(b - c) <= d:
            return True

    return False


if __name__ == "__main__":
    a, b, c, d = map(int, input().rstrip().split(' '))
    if talkable(a, b, c, d):
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
A, B, C, X, Y = map(int, input().split(' '))
ans = A * X + B * Y
for k in range(1, max(X, Y) + 1):
    _ans = 2 * C * k + max(X - k, 0) * A + max(Y - k, 0) * B
    if _ans < ans:
        ans = _ans
print(ans)

Fixed submission:
s = input()
count = 0
for i in range(3):
    if 'o' in s[i]:
        count += 1
print(700 + count * 100)
Buggy python submission (verdict: Runtime Error):
str = input()
k = int(input())

substr = []
for i in range(len(str)):
  substr.extend([str[i:j] for j in range(i+1,len(str) + 1)])

substr = list(set(substr))
substr.sort()
print(substr[k-1])

Fixed submission:
str = input()
k = int(input())
 
substr = []
for i in range(len(str)):
  substr.extend([str[i:j] for j in range(i+1,i+6)])
 
substr = list(set(substr))
substr.sort()
print(substr[k-1])
Buggy python submission (verdict: Runtime Error):
l = input().split()
n = int(l[0])
m = int(l[1])
x = int(l[2])
a = input().split()
i = 0
while(1):
    if int(a[i]) > x:
        break
    i = i + 1
if i < m - i:
    print(i)
else:
    print(m - i)


Fixed submission:
l = input().split()
a = int(l[0])
b = int(l[1])
x = int(l[2])

if (a > x) or (a + b < x):
    print('NO')
else:
    print('YES')
Buggy python submission (verdict: Runtime Error):
tmp=input().split()
a=int(tmp[0])
b=int(tmp[1])
c=int(tmp[2])
d=int(tmp[3])
Flag=False
ta=b-a
tb=c-b
tc=c-a
if ta<0:
    ta=ta*(-1)
if tb<0:
    tb=tb*(-1)
if tc<0:
.    tc=tc*(-1)
if tc<=d:
    Flag=True
if ta<=d and tb<=d:
    Flag=True
if Flag:
    print('Yes')
else:
    print('NO')


Fixed submission:
import sys
tmp=input().split()
a=int(tmp[0])
b=int(tmp[1])
c=int(tmp[2])
d=int(tmp[3])
da=a-b
db=b-c
dc=c-a
if a-b<0:
    da=b-a
if b-c<0:
    db=c-b
if c-a<0:
    dc=a-c
if dc<=d or da<=d and db<=d:
    print('Yes')
    sys.exit()
print('No')

Buggy python submission (verdict: Runtime Error):
import sys
tmp=input().split()
a=int(tmp[0])
b=int(tmp[1])
c=int(tmp[2])
d=int(tmp[3])
da=a-b
db=b-c
dc=c-a
if a-b<0:
    da=b-a
if b-c<0:
    db=c-b
if c-a<0:
    dc=a-c
if dc<=d or da<=d and db<d
    print('Yes')
    sys.exit()
print('No')


Fixed submission:
import sys
tmp=input().split()
a=int(tmp[0])
b=int(tmp[1])
c=int(tmp[2])
d=int(tmp[3])
da=a-b
db=b-c
dc=c-a
if a-b<0:
    da=b-a
if b-c<0:
    db=c-b
if c-a<0:
    dc=a-c
if dc<=d or da<=d and db<=d:
    print('Yes')
    sys.exit()
print('No')

Buggy python submission (verdict: Runtime Error):
tmp=int(input().split())
a=tmp[0]
b=tmp[1]
c=tmp[2]
d=tmp[3]
Flag=False
if (c-a)<d or (a-c)<d:
    Flag=True
if ((b-a)<d or (a-b)<d)and((c-b)<d or(b-c)<d):
    Flag=True
if Flag:
    print('Yes')
else:
    print('NO')

Fixed submission:
import sys
tmp=input().split()
a=int(tmp[0])
b=int(tmp[1])
c=int(tmp[2])
d=int(tmp[3])
da=a-b
db=b-c
dc=c-a
if a-b<0:
    da=b-a
if b-c<0:
    db=c-b
if c-a<0:
    dc=a-c
if dc<=d or da<=d and db<=d:
    print('Yes')
    sys.exit()
print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    b = list(a)
    del b[i]
    b.sort()
    print(b[int((n - 1) / 2)])

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

b = sorted(a)
m1 = b[n // 2]
m2 = b[n // 2 - 1]

for num in a:
    if(num < m1):
        print(m1)
    else:
        print(m2)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
import numpy as np
for i in range(n):
    print(int(np.median(a[0:i] + a[i+1:])))

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

b = sorted(a)
m1 = b[n // 2]
m2 = b[n // 2 - 1]

for num in a:
    if(num < m1):
        print(m1)
    else:
        print(m2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
a.append(0)
pay = [0] * N
flag = True

for i in range(N):
    if(flag == False):
           flag = True
    for j in range(N + 1):
        if(flag == False):
           flag = True
           continue

        if(i == N - j - 1):
            if(N - j - 2 >= 0):
                pay[i] += abs(a[N - j] - a[N - j - 2])
                flag = False
            else:
                pay[i] += abs(a[N - j])
                flag = False
        else:
            if(N - j - 1 >= 0):
                pay[i] += abs(a[N - j] - a[N - j - 1])
            else:
                pay[i] += abs(a[N - j])
    
for i in range(N):
    print("{0}".format(pay[i]))

Fixed submission:
pay = [int(input()) for i in range(4)]
# print(pay)
if(pay[0] < pay[1]):
    train = pay[0]
else:
    train = pay[1]
    
if(pay[2] < pay[3]):
    bus = pay[2]
else:
    bus = pay[3]

print("{0}".format(train + bus))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
import re
while(s != re.sub("ST", "", s)):
    s = re.sub("ST", "", s)
print(len(s))

Fixed submission:
s = input()
cnt = 0
t = 0
for c in s:
    if(c == "S"):
        cnt += 1
    else: # T
        if(cnt > 0):
            cnt -= 1
        else:
            t += 1
print(cnt + t)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
while(s != s.replace("ST", "")):
    s = s.replace("ST", "")
print(len(s))

Fixed submission:
s = input()
cnt = 0
t = 0
for c in s:
    if(c == "S"):
        cnt += 1
    else: # T
        if(cnt > 0):
            cnt -= 1
        else:
            t += 1
print(cnt + t)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
while(s != s.replace("ST", "", 1)):
    s = s.replace("ST", "", 1)
print(len(s))

Fixed submission:
s = input()
cnt = 0
t = 0
for c in s:
    if(c == "S"):
        cnt += 1
    else: # T
        if(cnt > 0):
            cnt -= 1
        else:
            t += 1
print(cnt + t)
Buggy python submission (verdict: Runtime Error):
def Exponential():
    X = int(input())
    res=1
    for b in range(1, X+1):
        for p in range(2, int(X/2)+1, 1): 
            if b**p >X: break
            else:
                res = max(b**p, res)
    print(res)
Exponential()

Fixed submission:
def ColorfulTransceivers():
    
    def checker(number):
        return (number<1 or number>100)
    
    raw = input()
    input_list = raw.split(" ")
    try :
        [a,b,c,d] = [int(i) for i in input_list]
    except ValueError:
        return("Oops!  There is no int input.")
    if (sum([checker(i) for i in [a,b,c,d]])): 
        return("Oops!  There is no validate data.")
    elif abs(c-a)<=d:
        print("Yes")
    elif abs(b-a)<=d and abs(c-b)<=d:
        print("Yes")
    else:
        print("No")

ColorfulTransceivers()

Buggy python submission (verdict: Runtime Error):
a b c d = map(int,input().split())
dis_ab = abs(a-b)
dis_bc = abs(b-c)
 
if dis_ab <= d and dis_bc <= d:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b,c,d = map(int,input().split())
dis_ab = abs(a-b)
dis_bc = abs(b-c)
dis_ac = abs(a-c)

if dis_ab <= d and dis_bc <= d:
  print('Yes')
elif dis_ac <= d:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
A, B, C, X, Y = map(int, input().split())
l = 0;
d = C - 0.5*A - 0.5*B
if(d<0):
    l=min(2*X, 2*Y)
else:
    l=0
print(str(int(A*X + B*Y + d*l)))

Fixed submission:
S = input()
n = S.count("o")
print(str(700+100*n))
Buggy python submission (verdict: Runtime Error):
import math

print(int(math.sqrt(int(input())))**2)


Fixed submission:
ls = list(map(lambda x: int(x), input().split()))
if abs(ls[0] - ls[2]) <= ls[3] or (abs(ls[0] - ls[1]) <= ls[3] and abs(ls[1] - ls[2]) <= ls[3]):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
def main:
  s= raw_input().split()
  ab=abs(s[0]-s[1])
  bc=abs(s[1]-s[2])
  ac=abs(s[0]-s[2])
  
  if ac<=s[3]:
    print("Yes")
  else:
    if ab<=s[3] and bc<=s[3]:
      print("Yes")
    else:
      print("No")

Fixed submission:
s= input().split()
ab=abs(int(s[0])-int(s[1]))
bc=abs(int(s[1])-int(s[2]))
ac=abs(int(s[0])-int(s[2]))

if ac<=int(s[3]):
  print("Yes")
else:
  if ab<=int(s[3]) and bc<=int(s[3]):
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n=int(input())
    x = [int(i) for i in input().split()]
    x = tuple(x)
    for i in range(n):
        x_l=list(x)
        del x_l[i]
        x_l.sort()
        print(x_l[int((len(x_l)-1)/2)])
            
main()

Fixed submission:
def main():
    n=int(input())
    x = [int(i) for i in input().split()]
    x_t = tuple(x)
    x.sort()
    l = x[int((len(x)/2 - 1))]
    u = x[int((len(x)/2))]
    for i in range(len(x_t)):
        if (x_t[i]<=l):
            print(u)
        else:
            print(l)
            
main()
Buggy python submission (verdict: Runtime Error):
s = input()
n = input()
ans = set([])
test = list(s)

for i in range(len(test)):
    s = test[i]
    ans.add(s)
    for j in range(i+1, min(i+5, len(test)):
        s = s + test[j]
        ans.add(s)
    
ans = list(ans)

ans.sort()
print(ans)
print(ans[int(n)-1])

Fixed submission:
s = input()
n = input()
ans = set([])
test = list(s)

for i in range(len(test)):
    s = test[i]
    ans.add(s)
    for j in range(i+1, min(i+5, len(test))):
        s = s + test[j]
        ans.add(s)
    
ans = list(ans)

ans.sort()
print(ans[int(n)-1])
Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    N = int(input())
    K = int(input())
    x = list(map(int, input().split()))
    ans = 0
    for i in range(N):
        r = min(x[i],abs(K-x[i]))
        ans += 2*r
    print(ans)

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__ =='__main__':
    N = input()
    A = input()
    ans = N**2-A
    print(ans)

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__ =='__main__':
    N ＝ input()
    A = input()
    ans = N**2 - A
    print(ans)

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__ =='__main__':
    N ＝ input()
    A = input()
    ans = N**2 - A
    print ans

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__ =='__main__':
    N ＝ input()
    A = input()
    ans = N**2 - A
    print ans

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__ =='__main__':
    N ＝ input()
    A = input()
    ans = N**2 - A
    print ans

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__ =='__main__':
    N ＝ input()
    A = input()
    ans = N**2 - A
    print ans

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__ =='__main__':
    N ＝ raw_input()
    A = raw_input()
    ans = N**2 - A
    print ans

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__ =='__main__':
    N ＝ raw_input()
    A = raw_input()
    ans = N**2 - A
    return N-A

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)

Buggy python submission (verdict: Runtime Error):
if __name__ =='__main__':
    N ＝ raw_input()
    A = raw_input()
    N = N**2
    return N-A

Fixed submission:
if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)
Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    N = int(input())
    K = int(input())
    x = map(int, input().split())
    ans = 0
    for i in range(N):
        r = min(x[i],abs(K-x[i]))
        ans += 2*r
    print(ans)

Fixed submission:
if __name__ == "__main__":
    N = int(input())
    K = int(input())
    x = list(map(int, input().split()))
    ans = 0
    for i in range(N):
        r = min(x[i],abs(K-x[i]))
        ans += 2*r
    print(ans)