Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
def banned_count(seq):
    for i in range(N):
        C[A[i]] -= 1
        print(sum([comb(j, 2, exact=True) for j in C.values()]))
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from operator import mul
from functools import reduce
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
N = int(input())
A = input().split()
C = Counter(A)
def banned_count(seq):
    for i in range(N):
        count = 0
        C[A[i]] -= 1
        for j in C.values():
            if j >= 2:
                count = count + cmb(j, 2)
        print(count)
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
def banned_count(seq):
    
    for i in range(N):
        count = 0
        C[A[i]] -= 1
        for j in C.values():
            if j >= 2:
                count = count + comb(j, 2, exact=True)
        print(count)
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
def banned_count(seq):
    for i in range(N):
        C[A[i]] -= 1
        d = [comb(j, 2, exact=True) for j in C.values()]
        count = sum(d)
        print(count)
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from operator import mul
from functools import reduce
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
N = int(input())
A = input().split()
C = Counter(A)
def banned_count(seq):
    for i in range(N):
        count = 0
        C[A[i]] -= 1
        for j in C.values():
            if j >= 2:
                count = count + cmb(j, 2)
        print(count)
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
def banned_count(seq):
    for i in range(N):
        count = 0
        C[A[i]] -= 1
        for j in C.values():
            if j >= 2:
                count = count + comb(j, 2, exact=True)
        print(count)
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
def banned_count(seq):
    for i in range(N):
        count = 0
        C[A[i]] -= 1
        for j in C.values():
            if j >= 2:
                count += comb(j, 2, exact=True)
        print(count)
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from scipy.misc import comb
N = int(input())
A = [int(x) for x in input().split()]
C = Counter(A)
def banned_count(seq):
    for i in range(N):
        count = 0
        C[A[i]] -= 1
        for j in C.values():
            if j >= 2:
                count += comb(j, 2, exact=True)
        print(count)
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from scipy.misc import comb
N = int(input())
A = [int(x) for x in input().split()]
C = Counter(A)
def banned_count(seq):
    for i in range(N):
        count = 0
        C[A[i]] -= 1
        for j in C.values():
            count += comb(j, 2, exact=True)
        print(count)
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
from scipy.misc import comb
N = int(input())
A = [int(x) for x in input().split()]
C = collections.Counter(A)
def banned_count(seq):
    for i in range(N):
        count = 0
        C[A[i]] -= 1
        for j in C.values():
            count += comb(j, 2, exact=True)
        print(count)
        C[A[i]] += 1
banned_count(A)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
A = input().split()
C = Counter(A)
s = sum([comb(j, 2, exact=True) for j in C.values()])
for i in range(N):
    print(s-C[A[i]]+1)