Maupertuis principle says that if we know the initial and final coordinates but not time, the total energy and the fact that energy is conserved, we can choose the "right" path from all mathematically possible paths (those that have same energy E and follow the conservation of energy) by minimizing the action integral which is given by
$S = \int p\mathrm{d}q$ taken from initial coordinates to final.
So consider two paths that are mathematically possible in the sense that they follow law of conservation of energy. Then for both paths, the Hamiltonian is time-independent. In section 44 in Landau & Lifshitz, they say
" Thus the abbreviated action has a minimum with respect to all paths which satisfy the law of conservation of energy and pass through the final point at any instant".
This statement suggests that the action is minimum for all mathematically possible paths because for all of these virtual paths, the energy is conserved.
So i feel it contradicts the fact that abbreviated action is minimized only for the correct path. Please help me what i am thinking wrong.