import io import sys from collections import defaultdict, deque, Counter from itertools import permutations, combinations, accumulate from heapq import heappush, heappop from bisect import bisect_right, bisect_left from math import gcd import math _INPUT = """\ 6 7 22 5 10 15 20 25 30 35 10 5 4 3 2 5 10 7 1 5 10 15 20 25 30 35 10 5 4 3 2 5 10 7 1000000000 5 10 15 20 25 30 35 10 5 4 3 2 5 10 10 23 3 1 4 1 5 9 2 6 5 3 2 7 1 8 2 8 1 8 2 8 """ def input(): return sys.stdin.readline()[:-1] def solve(test): N,H=map(int, input().split()) A=list(map(int, input().split())) B=list(map(int, input().split())) b=[0]+list(accumulate(B)) now=0 ans=0 h=0 a=0 for i in range(N): while now