Problem 1. Searching for soulmates
Farmer Johns cows each want to find their soulmate -- another cow with similar characteristics with whom they are maximally compatible. Each cows personality is described by an integer pipi (1≤pi≤1018). Two cows with …