Diffusive propagation of cosmic rays from supernova remnants in the Galaxy. I: spectrum and chemical composition