ṀṄ;©®œ^ - Helper link. Takes a list B on the left and a list C on the right
ṀṄ - Print the maximum of B
; - Prepend to C
© - Save that in the register R
®œ^ - Set difference between R and C
Rf@€ç/Ṁ - Main link. Takes A on the left, and L on the right
Rf@€ - Over each element, i, in A, keep the elements of L less than or equal to i
ç/ - Reduce by the helper link
Ṁ - Yield the maxmimum