Production of charged pions, kaons, and (anti-)protons in Pb-Pb and inelastic collisions at TeV