max sum path from two arrays