题目描述
Python 代码
def check(x):
s = 0
for ch in chs:
s += (ch[0]//x) * (ch[1]//x)##一定要注意括号
return s
if __name__ == '__main__':
n,k = map(int,input().split())
chs = []
r = 0
for _ in range(n):
h,w = map(int,input().split())
r = max(r,min(h,w))
chs.append([h,w])
l = 0
r += 1
while l+1 !=r:
mid = (l+r)//2
if check(mid)<k:
r = mid
else:
l = mid
print(l)