# explanation
## how to count number of pairs using frequency
In order to count how many pairs there are depending on the frequency of a number we use this formula:
pairs=frequencyβ(frequencyβ1)/2
Also let's not forget to use long long instead of int since we are dealing with 105 values therefore the max value is around (105)2, which is bigger than an int can support
Now that we know this, let's implement it
# Solution
#βclude<bitsstdc++.h>#defβeβ«longlongusingnamespacestd;sigβ dmaβ(){β«n,j;cββͺn;/idecdΒ¬βsβreallvaluesβaββr,youcandotΛβ«max