n = int(input(""))w1,w2,h1,h2 = list(map(int,input("").split()))volume = [int(n) for n in input("").split()]a = [w1**2,w2**2]h = [h1,h2]delta = []for vol in volume:height = vol/a[0]if height < h[0]:delta.append(height)h[0] -= heightelif height >= h[0]:if len(a) == 2:extra = (a[0]*(height-h[0]))/a[1]delta.append(h[0]+ extra)a.pop(0)h.pop(0)h[0] -= extraelse:delta.append(h[0])breakprint(int(max(delta)))
在計算extra時要考慮是否超過h[1]