completed maximum path I problem with brute force solver