Deformed states of neutron-deficient cerium and neodymium nuclei