max sum path between two sorted arrays