n, d = map(int, input().split()) x = list(map(int, input().split())) v = list(map(int, input().split())) num = sum(v) left = 0 right = 10**18 while left <= right: mid = (left + right) // 2 if num * mid >= d: right = mid - 1 else: left = mid + 1 print(left)