Count the Pairs

Problem Name:
Count the Pairs
Site:Spoj
Links:
Tags:
Problem setters:
Login to view your/friends' submissions
Login to suggest tags