Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
import pandas as pd

n, m = map(int, sys.stdin.readline().rstrip().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
df = pd.DataFrame(lines,
                  columns = ["price", "stock"],
                  dtype = float
                  )
df = df.sort_values(by="price")
price = 0
for i in range(n):
    if m - df.iloc[i]["stock"] > 0:
        price += df.iloc[i]["price"] * df.iloc[i]["stock"]
        m -= df.iloc[i]["stock"]
    else:
        price += df.iloc[i]["price"] * m
        break
print(int(price))


Fixed submission:
import sys
import numpy as np

n, m = map(float, input().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
lines.sort()
price = 0
for line in lines:
    if m - line[1] > 0:
        price += line[0] * line[1]
        m -= line[1]
    else:
        price += line[0] * m
        break
print(int(price))

Buggy python submission (verdict: Runtime Error):
import sys
import os

import numpy as np
import pandas as pd

n, m = map(int, input().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
df = pd.DataFrame(lines,
                  columns = ["price", "stock"],
                  dtype = float
                  )
df = df.sort_values(by="price")
price = 0
for i in range(n):
    if m - df.iloc[i]["stock"] > 0:
        price += df.iloc[i]["price"] * df.iloc[i]["stock"]
        m -= df.iloc[i]["stock"]
    else:
        price += df.iloc[i]["price"] * m
        break
print(int(price))

Fixed submission:
import sys
import numpy as np

n, m = map(float, input().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
lines.sort()
price = 0
for line in lines:
    if m - line[1] > 0:
        price += line[0] * line[1]
        m -= line[1]
    else:
        price += line[0] * m
        break
print(int(price))

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

import numpy as np
import pandas as pd

n, m = map(int, input().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
df = pd.DataFrame(lines,
                  columns = ["price", "stock"],
                  dtype = float
                  )
df = df.sort_values(by="price")
price = 0
for i in range(n):
    if m - df.iloc[i]["stock"] > 0:
        price += df.iloc[i]["price"] * df.iloc[i]["stock"]
        m -= df.iloc[i]["stock"]
    else:
        price += df.iloc[i]["price"] * m
        break
print(int(price))


Fixed submission:
import sys
import numpy as np

n, m = map(float, input().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
lines.sort()
price = 0
for line in lines:
    if m - line[1] > 0:
        price += line[0] * line[1]
        m -= line[1]
    else:
        price += line[0] * m
        break
print(int(price))

Buggy python submission (verdict: Runtime Error):
import numpy as np
import pandas as pd

n, m = map(int, input().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
df = pd.DataFrame(lines,
                  columns = ["price", "stock"],
                  dtype = float
                  )
df = df.sort_values(by="price")
price = 0
for i in range(n):
    if m - df.iloc[i]["stock"] > 0:
        price += df.iloc[i]["price"] * df.iloc[i]["stock"]
        m -= df.iloc[i]["stock"]
    else:
        price += df.iloc[i]["price"] * m
        break
print(int(price))

Fixed submission:
import sys
import numpy as np

n, m = map(float, input().split())
lines = sys.stdin.readlines()
lines = [list(map(float, line.strip().split())) for line in lines]
lines.sort()
price = 0
for line in lines:
    if m - line[1] > 0:
        price += line[0] * line[1]
        m -= line[1]
    else:
        price += line[0] * m
        break
print(int(price))