Observations have revealed massive (logM*/Msun>11) galaxies that were already dead when the universe was only ~2 Gyr. Given the short time before these galaxies were quenched, their past histories and quenching mechanism(s) are of particular interest. In this paper, we study star formation histories (SFHs) of 24 massive galaxies at 1.6<z<2.5. A deep slitless spectroscopy + imaging data set collected from multiple Hubble Space Telescope surveys allows robust determination of their spectral energy distributions and SFHs with no functional assumption on their forms. We find that most of our massive galaxies had formed > 50% of their extant masses by ~1.5 Gyr before the time of observed redshifts, with a trend where more massive galaxies form earlier. Their stellar-phase metallicities are already compatible with those of local early-type galaxies, with a median value of logZ*/Zsun=0.25 and scatter of ~0.15dex. In combination with the reconstructed SFHs, we reveal their rapid metallicity evolution from z~5.5 to ~2.2 at a rate of ~0.2dex/Gyr in log Z*/Zsun. Interestingly, the inferred stellar-phase metallicities are, when compared at half-mass time, ~0.25dex higher than observed gas-phase metallicities of star forming galaxies. While systematic uncertainties remain, this may imply that these quenched galaxies have continued low-level star formation, rather than abruptly terminating their star formation activity, and kept enhancing their metallicity until recently.