def main(): N, D = (int(i) for i in input().split()) X = [int(i) for i in input().split()] V = [int(i) for i in input().split()] def is_ok(t): dist = 0 for i in range(N): dist += V[i] * t if dist >= D: return True else: return False def binary_search(): ng = 0 ok = D while abs(ok - ng) > 1: mid = ng + (ok - ng) // 2 if is_ok(mid): ok = mid else: ng = mid return ok print(binary_search()) if __name__ == '__main__': main()