For Problem E, simply use line sweep:
keep track of total a[i] and b[i] at each point. Then line sweep them.
a[i]
b[i]
For Problem E, simply use line sweep:
keep track of total
a[i]andb[i]at each point. Then line sweep them.