Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#coding: utf-8

def solve(a, b, c):
  if a == b + c:
    return "Yes"
  elif b == c + a:
    return "Yes"
  elif c == a + b:
    return "Yes"
  return "No"

print(solve(list(map(int, input().split()))))

Fixed submission:
# coding: utf-8

def solve_a():
    candies = list(map(int, input().split()))
    for c in candies:
        if 2 * c == sum(candies):
            return "Yes"
    return "No"

print(solve_a())

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
"""Fighting over Candies

@author: hijiri.n
@modified: 11-19-2016

"""


def solve():
    candies = list(map(int, input().split()))
    ach = sum(candies) // 2
    for c in candies:
        if c == ach:
            return "Yes"
    return "No"
 

print(solve_a())


Fixed submission:
# coding: utf-8

def solve_a():
    candies = list(map(int, input().split()))
    for c in candies:
        if 2 * c == sum(candies):
            return "Yes"
    return "No"

print(solve_a())

Buggy python submission (verdict: Runtime Error):
# coding: utf-8

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

rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    rect[a - 1] = (lambda c, r, p: [r, c][p * (c - r) < 0])([x, y][a > 2], rect[a - 1], int(not a % 2) - int(a % 2))

length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))

Fixed submission:
# coding: utf-8

def solve_a():
    candies = list(map(int, input().split()))
    for c in candies:
        if 2 * c == sum(candies):
            return "Yes"
    return "No"

print(solve_a())

Buggy python submission (verdict: Runtime Error):
# coding: utf-8

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

rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    rect[a - 1] = (lambda c, r, p: [r, c][p * (c - r) < 0])([x, y][a > 2], rect[a - 1], [1, -1][a % 2])

length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))

Fixed submission:
# coding: utf-8

def solve_a():
    candies = list(map(int, input().split()))
    for c in candies:
        if 2 * c == sum(candies):
            return "Yes"
    return "No"

print(solve_a())
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
"""Snuke's Coloring 2 (ABC Edit)

@author: hijiri.n
@modified: 11-19-2016

"""

def data(): return list(map(int, input().split()))


def solve(init, point):
    w, h, N = init
    rect = [0, w, 0, h]

    for p in point:
        x, y, a = p

        if [1, -1][a % 2] * ([x, y][a > 2] - rect[a - 1]) < 0:
            rect[a - 1] = [x, y][a > 2]

        if rect[1] <= rect[0] or rect[3] <= rect[2]:
            return 0
        
    return (rect[1] - rect[0]) * (rect[3] - rect[2])

i_in = data()
p_in = [data() for _ in i[-1]]
print(solve(i_in, p_in))

Fixed submission:
# coding: utf-8

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

rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    rect[a - 1] = (lambda c, r, p: [r, c][[c < r, c > r][p]])([x, y][a > 2], rect[a - 1], a % 2)

length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
 
w, h, N = list(map(int, input().split()))
 
rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    if [1, -1][a % 2] * ([a > 2] - rect[a - 1]) < 0:
        rect[a - 1] = [x, y][a > 2]
 
length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))

Fixed submission:
# coding: utf-8

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

rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    rect[a - 1] = (lambda c, r, p: [r, c][[c < r, c > r][p]])([x, y][a > 2], rect[a - 1], a % 2)

length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))
Buggy python submission (verdict: Runtime Error):
import sys
s=sys.stdin.readline()
print s[:5]+' '+s[6:13]+' '+s[14:]

Fixed submission:
import sys
s=sys.stdin.readline()
print(s[:5]+' '+s[6:13]+' '+s[14:])
Buggy python submission (verdict: Runtime Error):
ret=''
for i in range(tx-sx):
    ret=ret+'U'
for i in range(ty-sy):
    ret=ret+'R'
for i in range(tx-sx):
    ret=ret+'D'
import sys
inp=sys.stdin.readline()
sx,sy,tx,ty=map(lambda x: int(x), inp.split(' '))
for i in range(ty-sy+1):
    ret=ret+'L'
for i in range(tx-sx+1):
    ret=ret+'U'
for i in range(ty-sy+1):
    ret=ret+'R'
ret=ret+'DR'
for i in range(tx-sx+1):
    ret=ret+'D'
for i in range(ty-sy+1):
    ret=ret+'L'
ret=ret+'U'

Fixed submission:
import sys
inp=sys.stdin.readline()
sx,sy,tx,ty=map(lambda x: int(x), inp.split(' '))
ret=''
for i in range(ty-sy):
    ret=ret+'U'
for i in range(tx-sx):
    ret=ret+'R'
for i in range(ty-sy):
    ret=ret+'D'
for i in range(tx-sx+1):
    ret=ret+'L'
for i in range(ty-sy+1):
    ret=ret+'U'
for i in range(tx-sx+1):
    ret=ret+'R'
ret=ret+'DR'
for i in range(ty-sy+1):
    ret=ret+'D'
for i in range(tx-sx+1):
    ret=ret+'L'
ret=ret+'U'
print(ret)
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())

#output = np.ndarray((2*H,W))
output = list()

for i in range(0,H):
    #output[i] = input()
    strings = input()
    print(strings)
    print(strings)

Fixed submission:
# -*- coding: utf-8 -*-
s = input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
s = raw_input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])

Fixed submission:
# -*- coding: utf-8 -*-
s = input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
s = raw_input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])

Fixed submission:
# -*- coding: utf-8 -*-
s = input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])
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 (((s-x-y) <=k) and (0 <= (s-x-y))):
            count +=1
print(count)

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 x+y<=s and s-x-y<=k:
      count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S=[int(i) for i in input().split()]
a=0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z==S:
                a+=1
print(a)

Fixed submission:
K,S=[int(i) for i in input().split()]
a=0
for x in range(K+1):
    for y in range(K+1):
        z=S-x-y
        if 0<=z and K>=z:
            a+=1
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
K,S=input().split()
K,S=[int(K),int(S)]
a=0
for X in range(K+1):
    for Y in range(K+1):
        Z=S-X-Y
        if 0<=Z<=K and X+Y+Z==S:
           a+=1 
print(a)

Fixed submission:
K,S=input().split()
K,S=[int(K),int(S)]
a=0
for X in range(K+1):
    for Y in range(K+1):
        Z=S-X-Y
        if 0<=Z<=K:
           a+=1 
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
K,S=input().split()
K,S=[int(K),int(S)]
a=[]
for X in range(K+1):
    for Y in range(K+1):
        Z=S-X-Y
        if 0<=Z<=K and X+Y+Z==S:
            a.append(S)
print(len(a))

Fixed submission:
K,S=input().split()
K,S=[int(K),int(S)]
a=0
for X in range(K+1):
    for Y in range(K+1):
        Z=S-X-Y
        if 0<=Z<=K:
           a+=1 
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
K,S=input().split()
K,S=[int(K),int(S)]
a=[]
for X in range(K+1):
    for Y in range(K+1):
        for Z in range (K+1):
            if X+Y+Z==S:
                a.append(S)
print(len(a))

Fixed submission:
K,S=input().split()
K,S=[int(K),int(S)]
a=0
for X in range(K+1):
    for Y in range(K+1):
        Z=S-X-Y
        if 0<=Z<=K:
           a+=1 
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
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):
            s = x + y + z
            if s == S:
                count += 1

print(count)

Fixed submission:
# -*- coding: utf-8 -*-
K, S = map(int, input().split())

count = 0
for x in range(K + 1):
    for y in range(K + 1):
        z = S - x - y
        if 0 <= z <= K:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
A, B, N = map(int, input().split())
behavior = input()

for b in behavior:
  if b == 'S':
    if A > 0:
      A -= 1
  elif b == 'C':
    if B > 0:
      B -= 1
  elif b == 'E':
    if not ((A == 0) and (B == 0)):
      if A >= B:
        A -= 1
      else:
        B -= 1
print(A)
print(B)

Fixed submission:
sx, sy, tx, ty = map(int, input().split())
path = ''
for _ in range(tx - sx):
  path += 'R'
for _ in range(ty - sy):
  path += 'U'
for _ in range(tx - sx):
  path += 'L'
for _ in range(ty - sy):
  path += 'D'

  
path += 'D'
for _ in range(tx - sx + 1):
  path += 'R'
for _ in range(ty - sy + 1):
  path += 'U'
path += 'L'
path += 'U'
for _ in range(tx - sx + 1):
  path += 'L'
for _ in range(ty - sy + 1):
  path += 'D'
path += 'R'

print(path)
Buggy python submission (verdict: Runtime Error):
L, N = map(int,input().split())
words = []
for i in range(N):
  words.append(input())

words.sort()
print(''.join(words))

Fixed submission:
N, L = map(int,input().split())
words = []
for i in range(N):
  words.append(input())
 
words.sort()
print(''.join(words))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    x,y = map(int,input().split())
    count = num_cal(x,y)
    print(count)
    return

def num_cal(x,y):
    if x < 0 and y < 0:
        if x < y:
            swap = x
            x = y
            y = swap
    count = 0
    if x < 0:
        count += 1
        x = -x
    if -x == y:
        return count+1
    while True:
        x = x+1
        count = count+1
        if x == y:
            return count
        if -x == y:
            return count+1
    return count

if __name__ == '__main__':
    main()


Fixed submission:
[x,y]=[int(i) for i in input().split(" ")]
d=[y-x]
c={-1:1,1:0}
for i in [-1,1]:
 for j in [-1,1]:
   d.append(y*i-x*j+c[i]+c[j])
c=min(i for i in d if i>0)
print(c)

Buggy python submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
A = [-1]*N*N
sorted_X = sorted(X)
fail_flag = 0
for i in range(N):
	x = sorted_X[i]
	K = X.index(x)+1
	if A[x-1]==-1:
		A[x-1] = K
	else:
		print("No")
		fail_flag = 1
		break
	K_rest = K-1
	j = 0
	while K_rest>0:
		if j==x-1:
			print("No")
			fail_flag = 1
			break
		if A[j]==-1:
			A[j] = K
			K_rest = K_rest-1
		j = j+1

count = 0
num = 1
for i in range(N*N):
	if A[i]==-1:
		A[i] = num
		count = count+1
	if count==N-num:
		num = num+1
		count = 0

if fail_flag==0:
	print("Yes")
	for a in A:
		print(str(a), end=" ")



Fixed submission:
x, y = map(int, input().split())
if x==0 and y==0:
	print(0)
elif x>=0 and y==0:
	print(x+1)
elif x>=0 and y>=0:
	if x<=y:
		print(y-x)
	if x>y:
		print(x-y+2)
elif x>=0 and y<0:
	print(abs(x+y)+1)
elif x<0 and y==0:
	print(abs(x))
elif x<0 and y>=0:
	print(abs(x+y)+1)
elif x<0 and y<0:
	if x<=y:
		print(y-x)
	if x>y:
		print(x-y+2)

Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
K = 0
K = K+A[1]
if A[0]%2==0 and A[3]%2==0 and A[4]%2==0:
	K = K+A[0]+A[3]+A[4]
elif A[0]%2!=0 and A[3]%2!=0 and A[4]%2!=0:
	K = K+A[0]+A[3]+A[4]
elif A[0]+A[3]+A[4]<=2:
	pass
else:
	K = K+A[0]+A[3]+A[4]-1
print(K)


Fixed submission:
x, y = map(int, input().split())
if x==0 and y==0:
	print(0)
elif x>=0 and y==0:
	print(x+1)
elif x>=0 and y>=0:
	if x<=y:
		print(y-x)
	if x>y:
		print(x-y+2)
elif x>=0 and y<0:
	print(abs(x+y)+1)
elif x<0 and y==0:
	print(abs(x))
elif x<0 and y>=0:
	print(abs(x+y)+1)
elif x<0 and y<0:
	if x<=y:
		print(y-x)
	if x>y:
		print(x-y+2)

Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
K = 0
K = K+A[1]
if A[0]%2==0 and A[3]%2==0 and A[4]%2==0:
	K = K+A[0]+A[3]+A[4]
elif A[0]%2!=0 and A[3]%2!=0 and A[4]%2!=0:
	K = K+A[0]+A[3]+A[4]
elif A[0]+A[3]+A[4]<=2:
	pass
else:
	K = K+A[0]+A[3]+A[4]-1
print(K)


Fixed submission:
x, y = map(int, input().split())
if x==0 and y==0:
	print(0)
elif x>=0 and y==0:
	print(x+1)
elif x>=0 and y>=0:
	if x<=y:
		print(y-x)
	if x>y:
		print(x-y+2)
elif x>=0 and y<0:
	print(abs(x+y)+1)
elif x<0 and y==0:
	print(abs(x))
elif x<0 and y>=0:
	print(abs(x+y)+1)
elif x<0 and y<0:
	if x<=y:
		print(y-x)
	if x>y:
		print(x-y+2)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))
k = 0
for i in range(N-K+1):
	K_sum = max(0, sum(A[i:i+K]))
	K_pos = sum(map(lambda x:max(0, x), A[i:i+K]))
	loss = K_pos-K_sum
	if i==0:
		loss_min = loss
	if loss<loss_min:
		k = i
		loss_min = loss
K_sum_result = max(0, sum(A[k:k+K]))
result = K_sum_result + sum(map(lambda x:max(0, x), A[:k]+A[k+K:]))
print(result)




Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
k = 0
for i in range(N-K+1):
	if i>0:
		K_sum = K_sum-A[i-1]+A[i+K-1]
		K_sum0 = max(0, K_sum)
		K_pos = K_pos-max(0, A[i-1])+max(0, A[i+K-1])
	else:
		K_sum = sum(A[i:i+K])
		K_sum0 = max(0, K_sum)
		K_pos = sum(map(lambda x:max(0, x), A[i:i+K]))
	loss = K_pos-K_sum0
	if i==0:
		loss_min = loss
	if loss<loss_min:
		k = i
		loss_min = loss
K_sum_result = max(0, sum(A[k:k+K]))
result = K_sum_result + sum(map(lambda x:max(0, x), A[:k]+A[k+K:]))
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
### B
N, K = map(int, input().split())
A = list(map(int, input().split()))
result = 0
for i in range(N-K+1):
	K_sum = max(0, sum(A[i:i+K]))
	N_sum = K_sum + sum(map(lambda x:max(0, x), A[:i]+A[i+K:]))
	result = max(result, N_sum)
print(result)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
k = 0
for i in range(N-K+1):
	if i>0:
		K_sum = K_sum-A[i-1]+A[i+K-1]
		K_sum0 = max(0, K_sum)
		K_pos = K_pos-max(0, A[i-1])+max(0, A[i+K-1])
	else:
		K_sum = sum(A[i:i+K])
		K_sum0 = max(0, K_sum)
		K_pos = sum(map(lambda x:max(0, x), A[i:i+K]))
	loss = K_pos-K_sum0
	if i==0:
		loss_min = loss
	if loss<loss_min:
		k = i
		loss_min = loss
K_sum_result = max(0, sum(A[k:k+K]))
result = K_sum_result + sum(map(lambda x:max(0, x), A[:k]+A[k+K:]))
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
l = list(map(int,input().split()))
a = l[0]
b = l[1]
x = l[2]
if a%x != 0:
	a = a+x-(a%x)
r =[i for i in range(a,b+1,x)]
print(len(r))


Fixed submission:
l = list(map(int,input().split()))
a = l[0]
b = l[1]
x = l[2]
if a%x == 0:
	print(b//x-a//x +1)
else:
	print(b//x-a//x)

Buggy python submission (verdict: Time Limit Exceeded):
l = list(map(int,input().split()))
a = l[0]
b = l[1]
x = l[2]
count = 0
for i in range(a,b+1):
	if i%x == 0:
		count+=1

print(count)


Fixed submission:
l = list(map(int,input().split()))
a = l[0]
b = l[1]
x = l[2]
if a%x == 0:
	print(b//x-a//x +1)
else:
	print(b//x-a//x)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = [int(s) for s in input().split()]

is_success = True

if n % 2 == 1:
    is_success = lst.count(0) == 1

for i in range(n - 1, 0, -2):
    if lst.count(i) != 2:
        is_success = False
        break

if is_success:
    tmp = 1

    for _ in range(n // 2):
        tmp *= 2
        tmp %= 10 ** 9 + 7

    print(tmp)
else:
    print(0)

Fixed submission:
import collections

n = int(input())
lst = [int(s) for s in input().split()]

is_success = True

if n % 2 == 1:
    is_success = lst.count(0) == 1

counters = collections.Counter(lst)

for i in range(n - 1, 0, -2):
    if counters[i] != 2:
        is_success = False
        break

if is_success:
    tmp = 1

    for _ in range(n // 2):
        tmp *= 2
        tmp %= 10 ** 9 + 7

    print(tmp)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
a, op,  b = map(int, input().split())
if op =="+":
    print(int(a+b))
else:
    print(int(a-b))

Fixed submission:

a, op,  b = map(str, input().split())
if op =="+":
    print(int(a)+int(b))
else:
    print(int(a)-int(b))

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

Fixed submission:

a, op,  b = map(str, input().split())
if op =="+":
    print(int(a)+int(b))
else:
    print(int(a)-int(b))
Buggy python submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
A = b//x
B = a//x
if a%x == 0:
    print(A-B+1)
else:
    print(A-B)

Fixed submission:
a, b, c = map(str, input().split())
print(a[0]+b[0]+c[0])

Buggy python submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
A = b//x
B = a//x
if B%x == 0:
    print(A-B+1)
else:
    print(A-B)

Fixed submission:
a, b, c = map(str, input().split())
print(a[0]+b[0]+c[0])

Buggy python submission (verdict: Runtime Error):
a, b, c = map(input().split())
print(a[0]b[0]c[0])

Fixed submission:
a, b, c = map(str, input().split())
print(a[0]+b[0]+c[0])
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())
ans = 0
for i in range (a,b+1):
    if i%x == 0:
        ans += 1
    else:
        continue
print(ans)

Fixed submission:
a, b, x = map(int, input().split())
A = b//x
B = a//x
if a%x == 0:
    print(A-B+1)
else:
    print(A-B)
Buggy python submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1,n+1):
    if i =< k:
        ans += x
    else:
        ans += y
print(ans)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1,n+1):
    if i <= k:
        ans += x
    else:
        ans += y
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1:n):
    if i =< k:
        ans += x
    else:
        ans += y
print(ans)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1,n+1):
    if i <= k:
        ans += x
    else:
        ans += y
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1:n+1):
    if i =< k:
        ans += x
    else:
        ans += y
print(ans)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1,n+1):
    if i <= k:
        ans += x
    else:
        ans += y
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(n+1):
    if i =< k:
        ans += x
    else:
        ans += y
print(ans)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1,n+1):
    if i <= k:
        ans += x
    else:
        ans += y
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = input().split()
X = [0] * (N // 2)
count = 0

num = 2 ** (len(A) - len(set(A)))



for a in A:
    k = A.count(str(a))
    if k == 2:
        count += 1
    else:
        pass

K = 2 ** (count/2)

if A.count('0') == 2:
    print(0)
elif K == num:
    print(int(K))
else:
    print(0)

Fixed submission:
N = int(input())
o, h = N%2, N//2
arr = [0]*h
for a in map(int, input().split()):
    if a > 0:
        arr[a//2 - o] += 1
if all(c == 2 for c in arr):
    print((1 << h) % (10**9 + 7))
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N, x = map(int, input().split())
A = input().split()
alist = []
count = 0

for i in range(N):
    a = int(A[i])
    alist.append(a)

for ii in range(N - 1):
    if alist[int(ii)] + alist[int(ii) + 1] <= x:
        pass
    else:
        while alist[int(ii)] + alist[int(ii) + 1] > x:
            if alist[int(ii) + 1] > 0:
                alist[int(ii) + 1] -= 1
                count += 1
            else:
                alist[int(ii)] -= 1
                count += 1
            
print(count)


Fixed submission:
N, x = map(int, input().split())
A = input().split()
alist = []
count = 0

for i in range(N):
    a = int(A[i])
    alist.append(a)

for ii in range(N - 1):
    if alist[int(ii)] + alist[int(ii) + 1] <= x:
        pass
    else:
        while alist[int(ii)] + alist[int(ii) + 1] > x:
            if alist[int(ii) + 1] > 0:
                k = alist[int(ii)] + alist[int(ii) + 1] - x
                if k <= alist[int(ii) + 1]:
                    alist[int(ii) + 1] -= k
                    count += k
                else:
                    alist[int(ii)] -= k - alist[int(ii) + 1]
                    alist[int(ii) + 1] = 0
                    count += k
            
print(count)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split(" "))
goukei = k*(k-1)**(n-1)
print(goukei)

Fixed submission:
s = list(input().split(" "))
s_set = list(set(s))
print(len(s_set))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split(" "))
goukei = k*(k-1)**(n-1)
print(goukei)

Fixed submission:
s = list(input().split(" "))
s_set = list(set(s))
print(len(s_set))
Buggy python submission (verdict: Runtime Error):
N = int(input())
number = input().split(" ")
if N%2 == 0:
    count = 0
    for i in range(int(N/2)):
        if number.count(str(2*i +1)) == 2:
            count += 0
        else:
            count += 1
    if count != 0:
        print(0)
    else:
        print(2**(int(N/2)))
else:
    count = 0
    if "0" not in number:
        print(0)
    else:
        for i in range(int((N-1)/2)):
            if number.count(str(2*i+2)) == 2:
                count += 0
            else:
                count += 1
        if count != 0:
            print(0)
        else:
            print(2**(int((N-1)/2)))

Fixed submission:
parameter = input().split(" ")
a = int(parameter[0])
b = int(parameter[2])
if parameter[1] == "+":
    print(a+b)
else:
    print(a-b)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 22 16:06:57 2017

@author: 0048005387
"""

h, w = map(int, raw_input().split())
c=[]

for i in range(h):
    c.append(map(str, raw_input().split()))
    
for i in c:
    for j in i:
        print j
22 3    for j in i:
        print j


Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 22 16:06:57 2017

@author: 0048005387
"""

h, w = map(int, raw_input().split())
c=[]

for i in range(h):
    c.append(map(str, raw_input().split()))
    
for i in c:
    for j in i:
        print j
    for j in i:
        print j