Hanging Posters

  • + 0 comments
    from math import *
    n,h=list(map(int,input().split()))
    w=list(map(int,input().split()))
    l=list(map(int,input().split()))
    maxi=0
    for i in range(n):
        hei=ceil(max(0,(w[i]-l[i])+0.75*l[i]-h))
        if hei>maxi:
            maxi=hei
    print(maxi)