Symmetric schemes for the solution of Hamiltonian problems