Ranking and synchronization from pairwise measurements via SVD