DSA DPAIRS

[https://www.codechef.com/LRNDSA03/submit/DPAIRS]

how to make all distinct possible pairs?