Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - count[x] + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in range(A):
    print(S - count[x] + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in range(A):
    print(S - A.count(x) + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)/2
for x in range(A):
    print(S - A.count(x) + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += int(i*(i-1)/2)
for k in range(N):
    print(S - A.count(A[k]) + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in range(CA.values()):
    S += int(i*(i-1)/2)
for k in range(N):
    print(S - A.count(A[k]) + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
S = 0
for i in range(N):
    c = A.count(i)
    S += int(c*(c-1)/2)
for k in range(N):
    print(S - A.count(A[k]) + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
V,C = zip(*CA.most_common())
S = 0
for i in range(len(C)):
    S += int(C[i]*(C[i]-1)/2)
for k in range(N):
    print(S - A.count(A[k]) + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
V,C = zip(*CA.most_common())
S = 0
for i in range(len(C)):
    L = C[i]
    S += int(L*(L-1)/2)
for k in range(N):
    print(S - A.count(A[k]) + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
V,C = zip(*CA.most_common())
S = 0
for i in range(len(C)):
    L = C[i]
    if L == 1:
        break
    S += int(L*(L-1)/2)
for k in range(N):
    print(S - A.count(A[k]) + 1)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
V,C = zip(*CA.most_common())
S = 0
for i in range(len(C)):
    L = C[i]
    if L == 1:
        break
    S += int(L*(L-1)/2)
for k in range(N):
    SS = S - A.count(A[k]) + 1
    print(SS)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
B = CA.most_common()
S = 0
for i in range(len(B)):
    L = B[i][1]
    if L == 1:
        break
    S += int(L*(L-1)/2)
for k in range(N):
    SS = S - A.count(A[k]) + 1
    print(SS)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
B = CA.most_common()
S = 0
for i in range(len(B)):
    L = B[i][1]
    if L == 1:
        break
    S += int(L*(L-1)/2)
for k in range(N):
    SS = S - A.count(A[k]) + 1
    print(SS)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
    x = A[i]
    A[i] = 0
    CA = collections.Counter(A)
    B = CA.most_common()
    S = 0
    for j in range(len(B)):
        L = B[j][1]
        if L == 1:
            break
        S += int(L*(L-1)/2)
    print(S)
    A[i] = x

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
S = 0
for i in CA.values():
    S += i*(i-1)//2
for x in A:
    print(S - CA[x] + 1)