Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def nyu():
    N, M = map(int, input().split())
    X = list(map(int,input().split()))
    X.sort()
    return N,M,X


def kansu(N,M,X):

    x_abs = [X[m+1] -X[m] for m in range(M-1)]    
#    print(x_abs)
    cnt_n = N
    
    while cnt_n-1 > 0:
        x_abs[x_abs.index(max(x_abs))]  = 0
        cnt_n -= 1

    koma_max = 0
    for m in range(M-1):
        koma_max += x_abs[m]

    print(koma_max)


N,M,X = nyu()
#print(X)

if M == 1:
    print(0)
else:
    kansu(N,M,X)

#print(S)



Fixed submission:
def nyu():
    N, M = map(int, input().split())
    X = list(map(int,input().split()))
    X.sort()
    return N,M,X


def kansu(N,M,X):

    x_abs = [X[m+1] -X[m] for m in range(M-1)]    
#    print(x_abs)

    
    x_abs.sort()

    koma_max = 0
    for m in range(M-N):
        koma_max += x_abs[m]

    print(koma_max)


N,M,X = nyu()
#print(X)

if M == 1:
    print(0)
else:
    kansu(N,M,X)

#print(S)

Buggy python submission (verdict: Time Limit Exceeded):
def nyu():
    N, M = map(int, input().split())
    X = list(map(int,input().split()))
    X.sort()
    return N,M,X


def kansu(N,M,X):

    x_abs = [X[m+1] -X[m] for m in range(M-1)]    
#    print(x_abs)
    cnt_n = N
    
    while cnt_n-1 > 0:
        x_abs[x_abs.index(max(x_abs))]  = -1
        cnt_n -= 1

    koma_max = 0
    sum = 0
    for m in range(M-1):
        if x_abs[m] != -1:
            koma_max += x_abs[m]

    print(koma_max)

 


N,M,X = nyu()
#print(X)

if M == 1:
    print(0)
else:
    kansu(N,M,X)

#print(S)



Fixed submission:
def nyu():
    N, M = map(int, input().split())
    X = list(map(int,input().split()))
    X.sort()
    return N,M,X


def kansu(N,M,X):

    x_abs = [X[m+1] -X[m] for m in range(M-1)]    
#    print(x_abs)

    
    x_abs.sort()

    koma_max = 0
    for m in range(M-N):
        koma_max += x_abs[m]

    print(koma_max)


N,M,X = nyu()
#print(X)

if M == 1:
    print(0)
else:
    kansu(N,M,X)

#print(S)
Buggy python submission (verdict: Runtime Error):
def nyu():
    num1,num2,num3 = input().split()
    #num2 = list(map(int,input().split()))
    num1 = int(num1)
    num2 = int(num2)
    num3 = int(num3)
    return num1,num2,num3

def check(N,A,B):
    sum_cnt=0
    

    for n in range(N+1):
        sum:int = 0
        tmp_n = n
        sum += int(tmp_n/10000)
        tmp_n = tmp_n % 10000
        sum += int(tmp_n/10000)
        tmp_n = tmp_n % 1000
        sum += int(tmp_n/100)
        tmp_n = tmp_n % 100
        sum += int(tmp_n/10)
        tmp_n = tmp_n % 10
        sum += tmp_n
    
        if A<=sum and sum<=B:
        #    print("n=",n,"sum=", sum)
            sum_cnt +=n
    print(sum_cnt)

N,A,B=nyu()
check(N,A,B)



Fixed submission:
def nyu():
    num1,num2,num3 = input().split()
    #num2 = list(map(int,input().split()))
    num1 = int(num1)
    num2 = int(num2)
    num3 = int(num3)
    return num1,num2,num3

def check(N,A,B):
    sum_cnt=0
    sum = 0
    for n in range(N+1):
        sum = 0
    #     tmp_n = n
    #     sum += int(tmp_n/10000)
    #     tmp_n = tmp_n % 10000
    #     sum += int(tmp_n/10000)
    #     tmp_n = tmp_n % 1000
    #     sum += int(tmp_n/100)
    #     tmp_n = tmp_n % 100
    #     sum += int(tmp_n/10)
    #     tmp_n = tmp_n % 10
    #     sum += tmp_n
        n_str = str(n)
        l_n_str = list(n_str)
    #   print(l_n_str)
        for ln in l_n_str:
            sum += int(ln)

        if A<=sum and sum<=B:
#           print("n=",n,"sum=", sum)
            sum_cnt +=n
    print(sum_cnt)

N,A,B=nyu()
check(N,A,B)

Buggy python submission (verdict: Runtime Error):
def nyu():
    num1,num2,num3 = input().split()
    #num2 = list(map(int,input().split()))
    num1 = int(num1)
    num2 = int(num2)
    num3 = int(num3)
    return num1,num2,num3

def check(N,A,B):
    sum_cnt=0
    

    for n in range(N+1):
        sum:int = 0
        tmp_n = n
        sum += int(tmp_n/10000)
        tmp_n = tmp_n % 10000
        sum += int(tmp_n/10000)
        tmp_n = tmp_n % 1000
        sum += int(tmp_n/100)
        tmp_n = tmp_n % 100
        sum += int(tmp_n/10)
        tmp_n = tmp_n % 10
        sum += tmp_n
    
        if A<=sum and sum<=B:
        #    print("n=",n,"sum=", sum)
            sum_cnt +=n
    print(sum_cnt)

N,A,B=nyu()
check(N,A,B)



Fixed submission:
def nyu():
    num1,num2,num3 = input().split()
    #num2 = list(map(int,input().split()))
    num1 = int(num1)
    num2 = int(num2)
    num3 = int(num3)
    return num1,num2,num3

def check(N,A,B):
    sum_cnt=0
    sum = 0
    for n in range(N+1):
        sum = 0
    #     tmp_n = n
    #     sum += int(tmp_n/10000)
    #     tmp_n = tmp_n % 10000
    #     sum += int(tmp_n/10000)
    #     tmp_n = tmp_n % 1000
    #     sum += int(tmp_n/100)
    #     tmp_n = tmp_n % 100
    #     sum += int(tmp_n/10)
    #     tmp_n = tmp_n % 10
    #     sum += tmp_n
        n_str = str(n)
        l_n_str = list(n_str)
    #   print(l_n_str)
        for ln in l_n_str:
            sum += int(ln)

        if A<=sum and sum<=B:
#           print("n=",n,"sum=", sum)
            sum_cnt +=n
    print(sum_cnt)

N,A,B=nyu()
check(N,A,B)
Buggy python submission (verdict: Time Limit Exceeded):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
from queue import PriorityQueue
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

N, M = LI()
A = LI()

pq = PriorityQueue()
for a in A:
    pq.put((-a, a))

for i in range(M):
    val = pq.get()[1]
    val = math.floor(val/2)
    pq.put((-val, val))

ans = 0
while not pq.empty():
    ans += pq.get()[1]
print(ans)


Fixed submission:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
from queue import PriorityQueue
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

N, M = LI()
A = LI()

pq = PriorityQueue()
for a in A:
    pq.put((-a, a))

for i in range(M):
    val = pq.get()[1]
    val = math.floor(val/2)
    pq.put((-val, val))

ans = 0
while not pq.empty():
    ans += pq.get()[1]
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = [int(x)-1 for x in sys.stdin.readline().split()]

ans = 0
if B == 1:
    print(0)
else:
    while True:
        ans += 1
        if 1 + ans * A - ans >= B:
            print(ans)
            exit()

Fixed submission:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, os, pdb
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def perr(s): return print(s, file=sys.stderr)

A, B = LI()

ans = 0
current = 1
while current < B:
    current -= 1
    current += A
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

A,B,C,D = LI()

'''
cでもdでも割り切れない
逆に割り切れる数を計算する
Bまでで割り切れる個数
Aまでで割り切れる個数
B'-A'でA-Bまでの割り切れる個数が出せる
'''
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

BC = B//C
BD = B//D
BCD = B//lcm(C,D)

#  print('BC, BD, BCD', BC, BD, BCD)
B_count = B - (BC + BD - BCD)

A = A - 1
AC = A//C
AD = A//D
ACD = A//lcm(C,D)
#  print('AC, AD, ACD', AC, AD, ACD)

A_count = A - (AC + AD - ACD)

#  print(B_count, A_count)
print(B_count - A_count)


Fixed submission:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

A,B,C,D = LI()

'''
cでもdでも割り切れない
逆に割り切れる数を計算する
Bまでで割り切れる個数
Aまでで割り切れる個数
B'-A'でA-Bまでの割り切れる個数が出せる
'''
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

BC = B//C
BD = B//D
BCD = B//lcm(C,D)

#  print('BC, BD, BCD', BC, BD, BCD)
B_count = B - (BC + BD - BCD)

A = A - 1
AC = A//C
AD = A//D
ACD = A//lcm(C,D)
#  print('AC, AD, ACD', AC, AD, ACD)

A_count = A - (AC + AD - ACD)

#  print(B_count, A_count)
print(B_count - A_count)
Buggy python submission (verdict: Runtime Error):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N=_I()
S=input()
for sidx in range(N):
	if S[sidx]=="#":
		S=S[sidx:]
		break
while S[-1] != ".":
	S=S[:len(S)-1]

cd=S.count(".")
cs=S.count("#")

#print(cd,cs)
ans=min(cd,cs)
print(ans)

Fixed submission:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N=_I()
S=input()
#print(S)

black=0
white=S.count(".")
ans=white
for idx in range(len(S)):
	if S[idx] == "#":
		black+=1
	else:
		white-=1
	ans=min(ans,black+white)


	
print(ans)
Buggy python submission (verdict: Runtime Error):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)


N = I()
b = LI()

result = []
while True:
    #  print(b)
    for i in range(1, len(b)+1):
        #  print(i)
        if b[-i] == len(b)-i+1:
            #  print('break')
            result.append(b[-i])
            b.pop(b[-i])
            break
    else:
        if not b:
            break
        print(-1)
        exit()
for i in result[::-1]:
    print(i)



Fixed submission:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)


N = I()
b = LI()

result = []
while True:
    #  print(b)
    for i in range(1, len(b)+1):
        #  print(i)
        if b[-i] == len(b)-i+1:
            #  print('break')
            result.append(b[-i])
            del b[-i]
            break
    else:
        if not b:
            break
        print(-1)
        exit()
for i in result[::-1]:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools


sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

S = S()


result = 0
while True:
    if S.find('01') < 0 and S.find('10') < 0:
        print(result)
        exit()
    if S.find('01') >= 0:
        idx = S.find('01')
        S = S[:idx] + S[idx+2:]
        result += 2

    if S.find('10') >= 0:
        idx = S.find('10')
        S = S[:idx] + S[idx+2:]
        result += 2




Fixed submission:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools


sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

S = S()
#  S = ''
#  for i in range(10**5):
#      if i % 2 == 0:
#          S += '011'
#      else:
#          S += '1'
#  S = '011'*100000

#  print(S)
result = 0
# 0と1すくない方の数になる絶対
print(min(S.count('1'), S.count('0'))*2)
#  while True:
#      print('loop;')
#      if S.find('01') < 0 and S.find('10') < 0:
#          print(result)
#          exit()
#      if S.find('01') >= 0:
#          idx = S.find('01')
#          S = S[:idx] + S[idx+2:]
#          result += 2

#      if S.find('10') >= 0:
#          idx = S.find('10')
#          S = S[:idx] + S[idx+2:]
#          result += 2
Buggy python submission (verdict: Time Limit Exceeded):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools


sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    N = I()
    A = LI()
    #  print(N, A)


    # 余りを活用する
    A.sort(reverse=True)
    #  print(A)
    while len(A) > 1:
        A[0] = A[0] % A[1]
        if A[0] == 0:
            del A[0]
        A.sort(reverse=True)

    print(A[0])

main()


Fixed submission:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
import numpy as np

sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    N = I()
    A = LI()
    #  print(N, A)


    # 余りを活用する
    A = list(set(A))
    A.sort(reverse=True)
    if A[-1] == 0:
        del A[-1]
    #  print(A)
    while len(A) > 1:
        #  A[0] = A[0] % A[1]
        A = [a % A[idx+1] if idx < len(A) - 1 else a for idx, a in enumerate(A)]
        A = list(set(A))
        A.sort(reverse=True)
        if A[-1] == 0:
            del A[-1]

        #  if A[0] == 0:
        #      del A[0]

    print(A[0])

main()
Buggy python submission (verdict: Runtime Error):
import numpypy as np

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

Fixed submission:
AB, BC, CA = map(int, input().split())

result = int(AB * BC / 2)

print(result)

Buggy python submission (verdict: Runtime Error):
import numpypy as np

Fixed submission:
AB, BC, CA = map(int, input().split())

result = int(AB * BC / 2)

print(result)

Buggy python submission (verdict: Runtime Error):
 import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
from operator import itemgetter


sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

def main():
    # 種類最小から最大までそれぞれ計算する
    N, K = LI()
    T = []
    D = []
    TD = []
    for i in range(N):
        TD.append(LI())
    #  print(T, '\n', D)
    TD = sorted(TD, key=itemgetter(1), reverse=True)
    #  print('TD', TD)

    max_value_per_type = [[t, max([td[1] for td in TD if td[0] == t])]for t in set([i[0] for i in TD])]
    #  print('max_value_per_type', max_value_per_type)
    content_per_type = [[t, [i[1] for i in TD if i[0] == t]] for t in set(i[0] for i in TD)]
    #  print(content_per_type)
    max_idx_per_type = [i[1].index([mvpt[1] for mvpt in max_value_per_type if mvpt[0] == i[0]][0]) for i in content_per_type]
    #  print('max_idx_per_type', max_idx_per_type)
    for idx, i in enumerate(max_idx_per_type):
        del content_per_type[idx][1][i]
    #  remaining_values_per_type = [[c[0], [i[0] for i in content_per_type if ]] for c in content_per_type]
    #  print('各タイプから最大値を抜きました', content_per_type)
    results = [0]
    for i in range(1, K+1):
        #  print('\n---------\n',i,'回目')
        # iを種類数とみなす
        # 何を選んだかは関係ない
        
        # 種類の全組み合わせを求める
        #  print(i)
        if len(set([i[0] for i in TD])) < i:
            break 
        combinations = list(itertools.combinations(set([i[0] for i in TD]), i))
        #  print('combi', combinations)
        type_bonus = i * i
        for combination in combinations:
            #  print('\n')
            # 各組み合わせでの最大値を求める
            current_options = [i for i in TD if i[0] in combination]
            
    print(max(results))


main()


Fixed submission:
AB, BC, CA = map(int, input().split())

result = int(AB * BC / 2)

print(result)