Bruteforce implementation of closest pair in pascal