A Randomized Algorithm for Pairwise Clustering