Elastic deuteron scattering on 12C and 16O nuclei in the alpha-cluster model