Diffusion coefficient and acceleration spectrum from direct measurements of charged cosmic ray nuclei