output_description: For each k=1,2,...,N, print a line containing the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 A_2 ... A_N
attempt: n = int(input())
  a = [0 for i in range(n)]
  b = [0 for i in range(n)]
  c = [0 for i in range(n)]
  r = 0
  count = 0
  for i in input().split():
      a[int(i) - 1] += 1
      b[count] = int(i)
      count += 1
  for i in range(n):
      m = a[b[i] - 1]
      c[i] = 2 * m - 2
  for i in range(n):
      r += a[i] * (a[i] - 1)
  for i in range(n):
      print((r - c[i]) // 2)
  
problem_description: Statement
  
  We have N balls. The i-th ball has an integer A_i written on it.  
  For each k=1, 2, ..., N, solve the following problem and print the answer.
  
    * 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.
samples: [{"input": "5\n    1 1 2 1 2", "output": "2\n    2\n    3\n    2\n    3\n    \n\nConsider the case k=1 for example. The numbers written on the remaining balls\nare 1,2,1,2.  \nFrom these balls, there are two ways to choose two distinct balls so that the\nintegers written on them are equal.  \nThus, the answer for k=1 is 2.\n\n* * *"}, {"input": "4\n    1 2 3 4", "output": "0\n    0\n    0\n    0\n    \n\nNo two balls have equal numbers written on them.\n\n* * *"}, {"input": "5\n    3 3 3 3 3", "output": "6\n    6\n    6\n    6\n    6\n    \n\nAny two balls have equal numbers written on them.\n\n* * *"}, {"input": "8\n    1 2 1 4 2 1 4 1", "output": "5\n    7\n    5\n    7\n    7\n    5\n    7\n    5"}]