Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
print("2018"+input[6:])

Fixed submission:
s=input()
s=s[:3]+"8"+s[4:]
print(s)

Buggy python submission (verdict: Runtime Error):
print(input[:3]+"8"+input[6:])

Fixed submission:
s=input()
s=s[:3]+"8"+s[4:]
print(s)

Buggy python submission (verdict: Runtime Error):
print(input[:3]+'8'+input[6:])

Fixed submission:
s=input()
s=s[:3]+"8"+s[4:]
print(s)

Buggy python submission (verdict: Runtime Error):
S=input()
S=s[:3]+"8"+s[:6]
print(S)

Fixed submission:
s=input()
s=s[:3]+"8"+s[4:]
print(s)

Buggy python submission (verdict: Runtime Error):
S=input()
print(s[:3]+8+s[:6])

Fixed submission:
s=input()
s=s[:3]+"8"+s[4:]
print(s)

Buggy python submission (verdict: Runtime Error):
S=input()
new=S.split('2017')
print('2018'+new)

Fixed submission:
s=input()
s=s[:3]+"8"+s[4:]
print(s)

Buggy python submission (verdict: Runtime Error):
new=S.split('2017')


Fixed submission:
s=input()
s=s[:3]+"8"+s[4:]
print(s)

Buggy python submission (verdict: Runtime Error):
new=S.split('2017')
print('2018'+new)

Fixed submission:
s=input()
s=s[:3]+"8"+s[4:]
print(s)
Buggy python submission (verdict: Runtime Error):
n=input()
n=n.remove(1)
n=list(n)
print(len(n))

Fixed submission:
n=int(input())
print(len(list(set([int(input()) for x in range(n)]))))

Buggy python submission (verdict: Runtime Error):
n=input()
n=del n[0]
n=list(n)
print(len(n))

Fixed submission:
n=int(input())
print(len(list(set([int(input()) for x in range(n)]))))
Buggy python submission (verdict: Runtime Error):
print(M-input())

Fixed submission:
print(48-int(input()))

Buggy python submission (verdict: Runtime Error):
M=input()
M=48-M
print(M)

Fixed submission:
print(48-int(input()))

Buggy python submission (verdict: Runtime Error):
N=input()
print(48-N)

Fixed submission:
print(48-int(input()))

Buggy python submission (verdict: Runtime Error):
N=input()
M=48-N
print(M)

Fixed submission:
print(48-int(input()))

Buggy python submission (verdict: Runtime Error):
def isprime(z):
    if z < 2:return False
    if z == 2:return True
    i = 2
    while i*i <= z:
        if z % i == 0:
            return False
        i+=1
    return True
n = int(input())
for i in range(n):
    l, r = map(int, input().split())
    c = 0
    for j in range(l, r+1):
        if isprime(j) and isprime((j+1)/2):
            c+=1
    print(c)
            

Fixed submission:
print(48-int(input()))

Buggy python submission (verdict: Runtime Error):
def isprime(z):
    if z < 2:return False
    if z == 2:return True
    i = 2
    while i*i <= z:
        if z % i == 0:
            return False
        i+=1
    return True
n = int(input())
for i in range(n):
    l, r = map(int, input().split())
    c = 0
    for j in range(l, r+1):
        if isprime(j) and isprime((j+1)/2):
            c+=1
    print(c)
            

Fixed submission:
print(48-int(input()))
Buggy python submission (verdict: Runtime Error):
def search(value, ten, five, one, num):
    global ans
    if ans or value < 0:
        return
    
    if value == 0 and (ten+five+one) == num:
        ans = (ten, five, one)
    search(value-10, ten+1,five,one, num)
    search(value-5, ten, five+1, one, num)
    search(value-1, ten, five,one+1,  num)

num, value = map(int, input().split())
value //= 1000
num_ten = 0
num_five = 0
num_one = 0
ans = None
if (num-1)*100 < value < num*100:
    print("-1 -1 -1")
else:
    search(value, num_ten, num_five, num_one, num)
    print(ans[0], ans[1], ans[2])

Fixed submission:
inputs = input().split("/")
if inputs[0] is not '2018':
    inputs[0] = "2018"
print("/".join(inputs))

Buggy python submission (verdict: Runtime Error):
n, h = (int(s) for s in input().split())

a = []
b = []

for i in range(n):
    a_i, b_i = (int(s) for s in input().split())
    a.append(a_i)
    b.append(b_i)

a_max = max(a)
b.sort(reverse=True)

for i, b_i in enumerate(b):
    if b_i > a_max:
        h -= b_i
        if h <= 0:
            print(i + 1)
            break
    else:
        print(i + (h - 1) // a_max + 1)
        break
else:
    print(len(b) + (h - 1) // a_max + 1)


Fixed submission:
print('2018' + input()[4:])

Buggy python submission (verdict: Runtime Error):
n = int(input())
mochi = [int(input()) for i in range(n)]
mochi.sort(reverse=True)

size = 0
max = 9999999999

for m in mochi:
    # print(m)
    if m < max:
        size += 1
        max = m
# 出力
print(size)


Fixed submission:
# -*- coding: utf-8 -*-
date = input()
# 出力
print("2018", date[4:], sep="")

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
date = input()
# 出力
print "2018" + date[4:]

Fixed submission:
# -*- coding: utf-8 -*-
date = input()
# 出力
print("2018", date[4:], sep="")
Buggy python submission (verdict: Runtime Error):
n = int(input())
mochi = [int(input()) for i in range(n)]
mochi.sort(reverse=True)

size = 0
max = 9999999999

for m in mochi:
    //print(m)
    if m < max:
        size += 1
        max = m
# 出力
print(size)


Fixed submission:
n = int(input())
mochi = [int(input()) for i in range(n)]
mochi.sort(reverse=True)

size = 0
max = 9999999999

for m in mochi:
    # print(m)
    if m < max:
        size += 1
        max = m
# 出力
print(size)
Buggy python submission (verdict: Runtime Error):
import math
N,H = map(int,input().split())

aList = []
bList = []
for count in range(0,N):
    a,b = map(int, input().split())
    aList.append(a)
    bList.append(b)

bList.sort()
bList.reverse()

maxA = max(aList)

count = 0
damage = 0
for b in bList:
    if maxA < b:
        damage+=b
        count+=1
    if damage >= H:
        break

if damage < H:
    remainingHP = H - damage
    count = count + math.ceil(remainingHP / maxA)

print(count)

Fixed submission:
S = input()

dest = S.replace("2017", "2018")

print(dest)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
S = input()

sliceA = S[0:A]
sliceB = S[A+1:A+B+1]

if sliceA.isdigit() and sliceB.isdigit() and S.find("-") == A and len(sliceA) == A and len(sliceB) == B:
    print("yes")
else:
    print("no")

Fixed submission:
M = int(input())
twoDays = 48
print(twoDays - M)
Buggy python submission (verdict: Time Limit Exceeded):
import math

def isPrimeNumber(num):
    isPrimeNum = True
    for i in range(2,math.floor(math.sqrt(num)) + 1):
        if num % i == 0:
            isPrimeNum = False

    if num == 1:
        isPrimeNum = False

    return isPrimeNum

def is2017alikeNum(num):
    is2017alikeNum = False
    alikeNum = (num + 1) / 2
    if isPrimeNumber(num) and isPrimeNumber(alikeNum):
        is2017alikeNum = True
    return is2017alikeNum


N = int(input())
inputList = []
for count in range(0,N):
    l,r = map(int, input().split())
    tempList = [l,r]
    inputList.append(tempList)

for i in range(0,N):
    l = inputList[i][0]
    r = inputList[i][1]

    count = 0
    for j in range(l, r + 2 , 2):
        if is2017alikeNum(j):
            count += 1

    print(count)

Fixed submission:
import math

def isPrimeNumber(num):
    isPrimeNum = True
    for i in range(2,math.floor(math.sqrt(num)) + 1):
        if num % i == 0:
            isPrimeNum = False

    if num == 1:
        isPrimeNum = False

    return isPrimeNum

def is2017alikeNum(num):
    is2017alikeNum = False
    alikeNum = (num + 1) / 2
    if isPrimeNumber(num) and isPrimeNumber(alikeNum):
        is2017alikeNum = True
    return is2017alikeNum

count = 0
list = []
for i in range(1,100000,2):
    if is2017alikeNum(i):
        count += 1
    list.append(count)

N = int(input())
inputList = []
for count in range(0,N):
    l,r = map(int, input().split())
    tempList = [l,r]
    inputList.append(tempList)

for i in range(0,N):
    l = inputList[i][0]
    r = inputList[i][1]
    lIndex = int((l-1)/2)
    rIndex = int((r-1)/2)
    if lIndex == 0:
        lIndex += 1
    x = list[rIndex] - list[lIndex-1]

    print(x)
Buggy python submission (verdict: Runtime Error):
import math
N,H = map(int,input().split())

aList = []
bList = []
for count in range(0,N):
    a,b = map(int, input().split())
    aList.append(a)
    bList.append(b)

bList.sort()
bList.reverse()

maxA = max(aList)

count = 0
damage = 0
for b in bList:
    if maxA < b:
        damage+=b
        count+=1
    if damage > H:
        break

if damage < H:
    remainingHP = H - damage
    count = count + math.ceil(remainingHP / maxA)

print(count)

Fixed submission:
import math

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

mean = (a+b)/2
print(math.ceil(mean))
Buggy python submission (verdict: Runtime Error):
s = str(raw_input())
s = s.replace('2017', '2018', 1)
print(s)

Fixed submission:
s = str(raw_input())
s = s.replace('2017', '2018', 1)
print(s)

Buggy python submission (verdict: Runtime Error):
s = raw_input()
s = s.replace('2017', '2018', 1)
print(s)

Fixed submission:
s = str(raw_input())
s = s.replace('2017', '2018', 1)
print(s)

Buggy python submission (verdict: Runtime Error):
import re

s = str(raw_input)
s = re.sub('2018', '2017', s, 1)
print(s)

Fixed submission:
s = str(raw_input())
s = s.replace('2017', '2018', 1)
print(s)
Buggy python submission (verdict: Runtime Error):
s = '0'
l = []
ans = 0
temp = -1
n = raw_input()
for i in range(0, n):
    s = raw_input()
    if (s != ''):
        l += [int(s)]
l.sort()
for i in range(0, len(l)):
    if(l[i] != temp):
        ans += 1
        temp = l[i]

print(ans)

Fixed submission:
s = '0'
l = []
ans = 0
temp = -1
n = int(raw_input())
for i in range(0, n):
    s = raw_input()
    if (s != ''):
        l += [int(s)]
l.sort()
for i in range(0, len(l)):
    if(l[i] != temp):
        ans += 1
        temp = l[i]

print(ans)

Buggy python submission (verdict: Runtime Error):
s = '0'
l = []
ans = 0
temp = -1
while s != '' :
    s = raw_input()
    if (s != ''):
        l += [int(s)]
l.sort()
for i in range(0, len(l)):
    if(l[i] != temp):
        ans += 1
        temp = l[i]

print(ans)

Fixed submission:
s = '0'
l = []
ans = 0
temp = -1
n = int(raw_input())
for i in range(0, n):
    s = raw_input()
    if (s != ''):
        l += [int(s)]
l.sort()
for i in range(0, len(l)):
    if(l[i] != temp):
        ans += 1
        temp = l[i]

print(ans)

Buggy python submission (verdict: Runtime Error):
s = '0'
l = []
ans = 0
temp = -1
while s != '' :
    s = raw_input()
    if (s != ''):
        l += [int(s)]
l.sort()
for i in range(0, len(l)):
    if(l[i] != temp):
        ans += 1
        temp = l[i]

print ans

Fixed submission:
s = '0'
l = []
ans = 0
temp = -1
n = int(raw_input())
for i in range(0, n):
    s = raw_input()
    if (s != ''):
        l += [int(s)]
l.sort()
for i in range(0, len(l)):
    if(l[i] != temp):
        ans += 1
        temp = l[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()

print("2018"+s[4:])

Fixed submission:
s = input()

print("2018"+s[4:])

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

s[0] = '2'
s[1] = '0'
s[2] = '1'
s[3] = '7'

print s


Fixed submission:
s = input()

print("2018"+s[4:])
Buggy python submission (verdict: Runtime Error):
s=input()


try:
    s1,s2=s.split("-")
except Exception as e:
    print('No')
    sys.exit()

if(not s1.isdigit() or not s2.isdigit()):
    print('No')
    sys.exit()

if(len(s1)!=a or len(s2)!=b or len(s2)>5):
    print('No')
    sys.exit()

print('Yes')

Fixed submission:
import re,sys
a,b=map(int, input().split())
s=input()


try:
    s1,s2=s.split("-")
except Exception as e:
    print('No')
    sys.exit()

if(not s1.isdigit() or not s2.isdigit()):
    print('No')
    sys.exit()

if(len(s1)!=a or len(s2)!=b or len(s2)>5):
    print('No')
    sys.exit()

print('Yes')

Buggy python submission (verdict: Runtime Error):
l = map(int, raw_input().split())
k = raw_input()
listed = list(k)
if (len(k) == (l[0] + l[1] + 1)) and (listed[l[0]] == "-") and ((int(listed[l[0]+1]) in range(10)) and ((int(listed[l[0]-1])) in range(10))):
    print "Yes"
else:
    print "No"


Fixed submission:
l = map(int, raw_input().split())
k = raw_input()
listed = list(k)
if (len(k) == (l[0] + l[1] + 1)) and (listed[l[0]] == "-"):
    if (str("".join(listed[0:l[0]])).isdigit() == True) and (str("".join(listed[l[0]+1:len(listed)])).isdigit() == True):
        print "Yes"
        exit()
    print "No"
else:
    print "No"
Buggy python submission (verdict: Runtime Error):
l = list(map(int,raw_input).split())
if(l[0]+l[1]) > (l[2]+l[3]):
    print "Left"
elif (l[0] + l[1]) == (l[2] + l[3]):
    print "Balanced"
else:
    print "Right"


Fixed submission:
l = map(int,raw_input().split())
if(l[0]+l[1]) > (l[2]+l[3]):
    print "Left"
elif (l[0] + l[1]) < (l[2] + l[3]):
    print "Right"
elif (l[0] + l[1]) == (l[2] + l[3]):
    print "Balanced"
Buggy python submission (verdict: Time Limit Exceeded):
count = int(raw_input())
k = [int(raw_input()) for i in xrange(count)]
temp = []
for i in xrange(len(k)):
    if k[i] not in temp:
        temp.append(k[i])
    elif k[i] in temp:
        temp.remove(k[i])

print len(temp)


Fixed submission:
from collections import Counter

count = int(raw_input())
k = [int(raw_input()) for i in xrange(count)]
temp = Counter(k)
counter = 0
for key, value in temp.iteritems():
    if value % 2 != 0:
        counter += 1

print counter

Buggy python submission (verdict: Time Limit Exceeded):
count = int(raw_input())
k = [int(raw_input()) for i in range(count)]
temp = []
for i in range(len(k)):
    if k[i] not in temp:
        temp.append(k[i])
    elif k[i] in temp:
        temp.remove(k[i])

print len(temp)


Fixed submission:
from collections import Counter

count = int(raw_input())
k = [int(raw_input()) for i in xrange(count)]
temp = Counter(k)
counter = 0
for key, value in temp.iteritems():
    if value % 2 != 0:
        counter += 1

print counter
Buggy python submission (verdict: Runtime Error):
k = map(int, raw_input().split())
temp = [k[0]]
for i in xrange((k[0]*k[2])):
    if sum(temp) % k[1] == k[2]:
        print "YES"
        exit()
    temp.append(int(k[0]))

print "NO"




Fixed submission:
l = map(str, raw_input().split())
for i in range(len(l)-1):
    tempa = list(l[i])
    tempb = list(l[i+1])
    if tempa[len(tempa)-1] != tempb[0]:
        print "NO"
        exit(0)
print "YES"

Buggy python submission (verdict: Runtime Error):
l = map(str, raw_input().split())

for i in range(len(l)-1):
    if l[i][len(l)-1] == l[i+1][0]:
        print "YES"
        exit()
print "NO"


Fixed submission:
l = map(str, raw_input().split())
for i in range(len(l)-1):
    tempa = list(l[i])
    tempb = list(l[i+1])
    if tempa[len(tempa)-1] != tempb[0]:
        print "NO"
        exit(0)
print "YES"
Buggy python submission (verdict: Runtime Error):
import sys
sys.getrecursionlimit()
sys.setrecursionlimit(1000)

l = int(raw_input())

def factorial(l):
    if l == 0:
        return 1
    else:
        return l * factorial(l-1)
integ = factorial(l)
integ = integ
factors = []
i = 1

while(integ >= i):
    if (integ % i) == 0:
        factors.append(i)
    i+=1
print len(factors)
divisor = long(len(factors))
origin =long((10 ** 9) + 7)


Fixed submission:
l = map(int, raw_input().split())
if (l[0] * l[1]) > (l[2] * l[3]):
    print (l[0] * l[1])
    exit()
else:
    print (l[2] *  l[3])

Buggy python submission (verdict: Runtime Error):
inputted = int(raw_input())
l = list(raw_input())
x = 0
record = []
record.append(x)
for i in range(len(l)):
    if l[i] == "I":
        x+=1

    elif l[i] == "D":
        x-=1
    record.append(x)
print max(record)


Fixed submission:
l = map(int, raw_input().split())
if (l[0] * l[1]) > (l[2] * l[3]):
    print (l[0] * l[1])
    exit()
else:
    print (l[2] *  l[3])
Buggy python submission (verdict: Time Limit Exceeded):
import math

MAXN = 100001
isPrime = [True for x in range(0, MAXN)]

def findPrime():
    isPrime[1] = False
    for i in range(2, MAXN):
        if isPrime[i]:
            for j in range(i + i, int(math.sqrt(MAXN)) + 1, i):
                isPrime[j] = False

findPrime()

Q = int(input())

for i in range(Q):
    temp = 0
    l, r = map(int, input().split())
    for j in range(l, r + 1, 2):
        if isPrime[j] and isPrime[(j+1)//2]:
            temp += 1
    print(temp)




Fixed submission:
MAXN = 100001
isPrime = [True for x in range(0, MAXN)]

def findPrime():
    isPrime[1] = False
    for i in range(2, MAXN):
        if isPrime[i]:
            for j in range(i + i, MAXN, i):
                isPrime[j] = False

findPrime()

cache = [0 for x in range(0, MAXN)]

pSum = 0
for i in range(1, MAXN, 2):
    cache[i] = pSum
    if isPrime[i] and isPrime[(i+1)//2]:
        cache[i] += 1
    pSum = cache[i]

Q = int(input())

for i in range(Q):
    l, r = map(int, input().split())
    print(cache[r] - cache[l - 2])

Buggy python submission (verdict: Time Limit Exceeded):
MAXN = 100001
isPrime = [True for x in range(0, MAXN)]

def findPrime():
    isPrime[1] = False
    for i in range(2, MAXN):
        if isPrime[i]:
            for j in range(i + i, MAXN, i):
                isPrime[j] = False

findPrime()

Q = int(input())

for i in range(Q):
    temp = 0
    l, r = map(int, input().split())
    for j in range(l, r + 1, 2):
        if isPrime[j] and isPrime[(j+1)//2]:
            temp += 1
    print(temp)

Fixed submission:
MAXN = 100001
isPrime = [True for x in range(0, MAXN)]

def findPrime():
    isPrime[1] = False
    for i in range(2, MAXN):
        if isPrime[i]:
            for j in range(i + i, MAXN, i):
                isPrime[j] = False

findPrime()

cache = [0 for x in range(0, MAXN)]

pSum = 0
for i in range(1, MAXN, 2):
    cache[i] = pSum
    if isPrime[i] and isPrime[(i+1)//2]:
        cache[i] += 1
    pSum = cache[i]

Q = int(input())

for i in range(Q):
    l, r = map(int, input().split())
    print(cache[r] - cache[l - 2])
Buggy python submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
b  = 0
cnt = 0
while "loop":
    for num in a
        if num % 2 == 1:
            b= 1
    if  b == 0:
        for num in a
        num /=2
        cnt+=1
print(cnt)


Fixed submission:
import math
n = input()
a = list(map(int, input().split()))
b  = 0
cnt = 0
while "loop":
    for num in a:
        if num % 2 == 1:
            b= 1
    if  b == 0:
            a = [ i	/2 for i in a]
            cnt += 1
    else:
        break
print(cnt)

Buggy python submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
i = 0
cnt = 0
while "A":
    if bin(a[i][0]) == 0:
        a[i] /= 2
        cnt += 1
    else :
        break
print(cnt)


Fixed submission:
import math
n = input()
a = list(map(int, input().split()))
b  = 0
cnt = 0
while "loop":
    for num in a:
        if num % 2 == 1:
            b= 1
    if  b == 0:
            a = [ i	/2 for i in a]
            cnt += 1
    else:
        break
print(cnt)
Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n + 1):
  for j in range(n - j + 1):
    if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
      print(i, j, n - i -j)
      exit()
print("-1, -1, -1")


Fixed submission:
n, y = map(int, input().split())
for i in range(n + 1):
  for j in range(n - i + 1):
    if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
      print(i, j, n - i - j)
      exit()
print("-1 -1 -1")

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n + 1):
  for j in range(n - j + 1):
    if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
      print(i, j, n - i -j)
    exit()
    else:
      print(-1, -1, -1)
    exit()

Fixed submission:
n, y = map(int, input().split())
for i in range(n + 1):
  for j in range(n - i + 1):
    if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
      print(i, j, n - i - j)
      exit()
print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
N = int(input())
nums = input().split()
costs = []
if nums.count(nums[0]) != len(nums):
    for i in range(-100, 101):
        sum = 0
        for num in nums:
            sum += (int(num) - i) ** 2
        costs.append(sum)
    ans = min(costs)
else:
    ans = 0
print(ans)

Fixed submission:
count = int(input())
answer = 0
for i in range(1, count + 1):
    answer = answer + i
print(answer)
Buggy python submission (verdict: Runtime Error):
import math

N,A,B = map(int,input().split())
v = list(map(int,input().split()))

v.sort(reverse = True)
total = 0

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

for i in range(A):
    total = total + v[i]
else:
    print(total / A)
    
count = 0
min = v[A-1]
number = v.count(min)

if(v.index(min) == 0):
    for i in range(A,B+1):
        count = combinations_count(number,i) + count
    print(count)
else:
    print(combinations_count(number,A - v.index(min)))


Fixed submission:
import math

N,A,B = map(int,input().split())
v = list(map(int,input().split()))

v.sort(reverse = True)
total = 0

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

for i in range(A):
    total = total + v[i]
else:
    print(total / A)
    
count = 0
min = v[A-1]
number = v.count(min)

if(v.index(min) == 0):
    for i in range(A,number+1):
        if(i>B):
            break
        count = combinations_count(number,i) + count
    print(count)
else:
    print(combinations_count(number,A - v.index(min)))

Buggy python submission (verdict: Runtime Error):
import math

N,A,B = map(int,input().split())
v = [map(int,input().split())]

v.sort(reverse = True)
total = 0

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

for i in range(A):
    total = total + v[i]
else:
    print(total / A)
    
count = 0
min = v[A-1]
number = v.count(min)

if(v.index(min) == 0):
    for i in range(A,B+1):
        count = combinations_count(number,i) + count
    print(count)
else:
    print(combinations_count(number,A - v.index(min)))


Fixed submission:
import math

N,A,B = map(int,input().split())
v = list(map(int,input().split()))

v.sort(reverse = True)
total = 0

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

for i in range(A):
    total = total + v[i]
else:
    print(total / A)
    
count = 0
min = v[A-1]
number = v.count(min)

if(v.index(min) == 0):
    for i in range(A,number+1):
        if(i>B):
            break
        count = combinations_count(number,i) + count
    print(count)
else:
    print(combinations_count(number,A - v.index(min)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())

if(N==1):
  	print(K)
else:
	answer = K*(N-1)*(K-1)
	print(answer)

Fixed submission:
N,K= map(int,input().split())
if(N==1):
      print(K)
else:
    answer = K*((K-1)**(N-1))
    print(answer)
Buggy python submission (verdict: Runtime Error):
N = int(input())
for i in range(1,N):
  tmp += i
print(tmp)

Fixed submission:
N = int(input())
tmp =0
for i in range(1,N+1):
  tmp += i
print(tmp)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())

list = [a,b,c]

if(7 in list):
    if list.count(5)==2:
        print("YES")
    else:
        print("NO")
else:
    print("NO")


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

list = [a,b,c]

if(7 in list):
    if list.count(5)==2:
        print("YES")
    else:
        print("NO")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

ans = 0

for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z == S:
                # print([x,y,z])
                ans += 1

print(ans)

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

ans = 0

for x in range(K+1):
    for y in range(K+1):
        z = S-x-y
        if 0<=z and z<=K:
            # print([x,y,z])
            ans += 1

print(ans)

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

ans = 0

for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z == S:
                # print([x,y,z])
                ans += 1

print(ans)

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

ans = 0

for x in range(K+1):
    for y in range(K+1):
        z = S-x-y
        if 0<=z and z<=K:
            # print([x,y,z])
            ans += 1

print(ans)