{"raw_statement":[{"iden":"problem statement","content":"We have $N$ balls. The $i$\\-th ball has an integer $A_i$ written on it.  \nFor each $k=1, 2, ..., N$, solve the following problem and print the answer.\n\n*   Find the number of ways to choose two distinct balls (disregarding order) from the $N-1$ balls other than the $k$\\-th ball so that the integers written on them are equal."},{"iden":"constraints","content":"*   $3 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq A_i \\leq N$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $...$ $A_N$"},{"iden":"sample input 1","content":"5\n1 1 2 1 2"},{"iden":"sample output 1","content":"2\n2\n3\n2\n3\n\nConsider the case $k=1$ for example. The numbers written on the remaining balls are $1,2,1,2$.  \nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.  \nThus, the answer for $k=1$ is $2$."},{"iden":"sample input 2","content":"4\n1 2 3 4"},{"iden":"sample output 2","content":"0\n0\n0\n0\n\nNo two balls have equal numbers written on them."},{"iden":"sample input 3","content":"5\n3 3 3 3 3"},{"iden":"sample output 3","content":"6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them."},{"iden":"sample input 4","content":"8\n1 2 1 4 2 1 4 1"},{"iden":"sample output 4","content":"5\n7\n5\n7\n7\n5\n7\n5"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}