Find a path with certain sum