Harryxun/stf_run huggingface dataset:
nums = [int(input()) for _ in range(5)]
mn = float('inf')

for i in nums:
    if i%10!=0:
        mn = min(mn, i%10)
if mn == float('inf'):
    mn = 0

print(sum(list(map(lambda x: int(math.ceil(x/10)*10), nums)))-10+mn)


### FIXED CODE ###

import math
nums = [int(input()) for _ in range(5)]
mn = float('inf')

for i in nums:
    if i%10!=0:
        mn = min(mn, i%10)
if mn == float('inf'):
    mn = 10

print(sum(list(map(lambda x: int(math.ceil(x/10)*10), nums)))-10+mn)
K = int(input())
A, B = map(int, input().split())

for i in range(!, B+1):
    if i%K == 0:
        print("OK")
        exit()
print("NG")

### FIXED CODE ###

K = int(input())
A, B = map(int, input().split())

for i in range(A, B+1):
    if i%K == 0:
        print("OK")
        exit()
print("NG")
def main():
  n=int(input())
  a=list(map(int().split()))
  if 0 in A:
    print(0)
    return
  p=1
  for a in A:
    p=*=a
    if(a>1000000000000000000):
      print(-1)
      return
  print(p)
  

### FIXED CODE ###

def main ():
  N = int(input())
  A = list(map(int,input().split()))
  if 0 in A:
    print (0)
    return
  prod = 1 
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
  print(prod) 
main ()
N, Y = map(int, input().split())
for i in range(N+1):
    for j in range(N-i+1):
        if 10000*i + 5000*j + 1000*(N-i-j) == Y:
            print(i, j, n-i-j)
            exit()
print('-1 -1 -1')

### FIXED CODE ###

N, Y = map(int, input().split())
for i in range(N+1):
    for j in range(N-i+1):
        if 10000*i + 5000*j + 1000*(N-i-j) == Y:
            print(i, j, N-i-j)
            exit()
print('-1 -1 -1')
n,a,b=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=True)
ans=0
for i in range(a):
    ans+=v[i]
ans/=a
k=a-1
count=1
while k<=n-2:
    if v[k]==v[k+1]:
        count+=1
        k+=1
        continue
    else:
        break
k=a-1
cnt=1
while k>=1:
    if v[k]==v[k-1]:
        count+=1
        cnt+=1
        k-=1
        continue
    else:
        break
print(ans)

l=n
for i in range(1,n):
    if v[i]==v[0]:
        continue
    else:
        l=i
        break
        
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
print(l)
if l<a:
    print(cmb(count,cnt))
if a<=l<=b:
    x=0
    for i in range(a,l+1):
        x+=cmb(l,i)
    print(x)
else:
    x=0
    for i in range(a,b+1):
        x+=cmb(l,i)
    print(x)

### FIXED CODE ###

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,a,b=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=True)
ans=0
for i in range(a):
    ans+=v[i]
ans/=a
print(ans)
if v[0]==v[a-1]:
    count=0
    for i in range(n):
        if v[i]==v[0]:
            count+=1
    cnt=0
    for i in range(a,min(b,count)+1):
        cnt+=cmb(count,i)
    print(cnt)
else:
    count=0
    for i in range(n):
        if v[i]==v[a-1]:
            count+=1
    for i in range(n):
        if v[i]==v[a-1]:
            l=i
            break
    cnt=cmb(count,a-l)
    print(cnt)
import math
from functools import reduce

n=int(input())
lst=list(map(int,input().split()))
count=0

def gcd(*numbers):
    return reduce(math.gcd, numbers)

result = gcd(*lst)

while 1:
    if result%2 == 0:
        count += 1
        result //= 2
    else:
        break
print(count)

### FIXED CODE ###

n=int(input())
lst=list(map(int,input().split()))
count=0
def check(lst):
    for i in lst:
        if i%2 != 0:
            return False
    return True
def two_devision(lst):
    new_lst=[]
    for i in lst:
        new_lst.append(i//2)
    return new_lst
while check(lst):
    lst=two_devision(lst)
    count += 1
print(count)
S = input()

import string

S = list(sorted(S))
T = string.ascii_lowercase

flag = False

for t in T:
    if t in S:
        flag = True
        continue
    else:
        flag = False
        print(a)
        break
        
if flag:
    print("None")

### FIXED CODE ###

S = input()

import string

S = list(sorted(S))
T = string.ascii_lowercase

for t in T:
    if t not in S:
        print(t)
        break
        
else:
    print("None")
N=int(input())
S=list(map(int,input().split()))
print(S)
memo=[]
for i in range(S[0],S[N-1]):
    summ = 0
    for j in range(0,N):#実際にsumを求める
        summ+=(i-S[j])**2
    memo.append(summ)

print(min(memo))

### FIXED CODE ###

N=int(input())
S=list(map(int,input().split()))
memo=[]
for i in range(min(S)-100,max(S)+100):
    summ = 0
    for j in range(0,N):#実際にsumを求める
        summ+=(i-S[j])**2
    memo.append(summ)

print(min(memo))
c = 1
import math
a = int(input())
for i in range(1, int(math.sqrt(a))):
  for j in range(2, int(a/2):
    if i ** j <= a:
      c = max(c, i**j)
print(c)

### FIXED CODE ###

c = 1
a = int(input())
for i in range(1, int(a ** 0.5) + 1):
  for j in range(2, int(a/ 2)):
    if i ** j <= a:
      c = max(c, i**j)
print(c)
import sys

n, k=[int(x) for x in input().split()]
s=input()
l=[]
a='1'
for i in range(len(s)):
  if a != s[i]:
    l.append(i)
    a = s[i]
l.append(len(s))
if s[-1]=='0':
  l.append(0)
if len(l) <= 2*k+1:
  print(len(s))
  sys.exit()
m=0
ans=0
while m+ 2*k < len(s)-1:
  b = l[m+2*k]-l[m]
  if b>ans:
    ans=b
  m+=2
print(ans)

### FIXED CODE ###

import sys

n, k = [int(x) for x in input().split()]
s = input()
l = [0]
a = '1'
for i in range(n):
  if s[i] != a:
    l.append(i)
    a = s[i]
l.append(n)
if s[-1] == '0':
  l.append(n)
if len(l) < 2 * k + 2:
  print(n)
  sys.exit()
a, ans = 0, 0
while a + 2 * k + 1 < len(l):
  b = l[a+2*k+1] - l[a]
  if ans < b:
    ans = b
  a += 2
print(ans)
N = int(input())
dic = {}
for i in range(N):
  num = int(input())
  if dic.get(num) is None: 
    dic[n] = 1
  else:
    dic[n] += 1

ans = 0
for k in dic:
  if dic[k] >= k:
    ans += abs(dic[k] - k)
  else:
    ans += dic[k]
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
dic = {}
for i in range(N):
  if dic.get(A[i]) is None: 
    dic[A[i]] = 1
  else:
    dic[A[i]] += 1

ans = 0
for k in dic:
  if dic[k] >= k:
    ans += abs(dic[k] - k)
  else:
    ans += dic[k]
print(ans)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()
    a = LI()
    c = collections.Counter(a)
    if len(c) > 3:
        return "No"

    k = list(c.keys())
    t = [k[0], k[1]]
    def f(t):
        for i in range(n-2):
            u = t[i] ^ t[i+1]
            t.append(u)
        if t[0] ^ t[-2] != t[-1] or t[-1] ^ t[1] != t[0]:
            return False
        d = collections.Counter(t)
        if c != d:
            return False
        return True

    for g in k:
        for h in k:
            if f([g,h]):
                return 'Yes'

    return 'No'


print(main())





### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()
    a = LI()
    c = collections.Counter(a)
    if len(c) > 3:
        return "No"

    k = list(c.keys())
    def f(t):
        for i in range(n-2):
            u = t[i] ^ t[i+1]
            t.append(u)
        if t[0] ^ t[-2] != t[-1] or t[-1] ^ t[1] != t[0]:
            return False
        d = collections.Counter(t)
        if c != d:
            return False
        return True

    for g in k:
        for h in k:
            if f([g,h]):
                return 'Yes'

    return 'No'


print(main())
N = int(input())
P = list(map(int, input().split()))

for i in range(len(P)):
  if min(P[:i+1]) != P[i]:
    return i
  return len(P)

### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))
ret = 0
minval = 0
for i in range(len(P)):
  if i == 0:
    minval = P[i]
  if minval >= P[i]:
    ret += 1
    minval = P[i]
print(ret)
import math
a,b=map(int,input().split())
print(int(a*b/math.gcd(a,b)))


### FIXED CODE ###

import fractions
a,b=map(int,input().split())
print(int(a*b/fractions.gcd(a,b)))
h,w = int(input())
Array = [list(map(int, input().split())) for _ in range(h)]
dx = [1,1,0,-1,-1,-1,0,1]
dy = [0,1,1,1,0,-1,-1,-1]
for i in range(h):
  for j in range(w):
    if Array[i][j]='#':
      continue
      
    num=0
    for d in range(8):
      ni = i+dx[d]
      nj = j+dy[d]
      if ni<0 or h<=ni:
        continue
      if nj<0 or w<=nj:
        continue
      if Array[ni][nj]=='#':
        num=num+1
        
    Array[i][j]=char(num + '0')
    
for i in Array:
  print(*Array)

### FIXED CODE ###

h,w = map(int,input().split())
Array = [list(map(str,input())) for _ in range(h)]
dx = [1,1,0,-1,-1,-1,0,1]
dy = [0,1,1,1,0,-1,-1,-1]
for i in range(h):
  for j in range(w):
    if Array[i][j]=='#':
      continue
    num=0
    for d in range(8):
      ni = i+dy[d]
      nj = j+dx[d]
      if ni<0 or h<=ni:
        continue
      if nj<0 or w<=nj:
        continue
      if Array[ni][nj]=='#':
        num=num+1
    Array[i][j]=str(num)
    
for i in Array:
  print(*i, sep='')
x = raw_input().split()
a,op,b = x[0],x[1],x[2]
if op == "+":
	print a+b
elif op == "-":
	print a-b
elif op == "/":
	print a/b
elif op == "*":
	print a*b
else:
	break

### FIXED CODE ###

while 1:
	x = raw_input().split()
	a,op,b = int(x[0]),x[1],int(x[2])
	if op == "+":
		print a+b
	elif op == "-":
		print a-b
	elif op == "/":
		print a/b
	elif op == "*":
		print a*b
	else:
		break
ans = [0]*8
leng = 0

for i in range(N):
    if 1 <= A[i] <= 399:
        ans[0] = 1
    elif 400 <= A[i] <= 799:
        ans[1] = 1
    elif 800 <= A[i] <= 1199:
        ans[2] = 1
    elif 1200 <= A[i] <= 1599:
        ans[3] = 1
    elif 1600 <= A[i] <= 1999:
        ans[4] = 1
    elif 2000 <= A[i] <= 2399:
        ans[5] = 1
    elif 2400 <= A[i] <= 2799:
        ans[6] = 1
    elif 2800 <= A[i] <= 3199:
        ans[7] = 1
    else:
        leng += 1

maxi = sum(ans)+leng
mini = sum(ans)

if sum(ans)+leng >= 8:
    maxi = 8
if sum(ans) < 1:
    mini = 1

print(mini, maxi)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

ans = [0]*8
leng = 0

for i in range(N):
    if 1 <= A[i] <= 399:
        ans[0] = 1
    elif 400 <= A[i] <= 799:
        ans[1] = 1
    elif 800 <= A[i] <= 1199:
        ans[2] = 1
    elif 1200 <= A[i] <= 1599:
        ans[3] = 1
    elif 1600 <= A[i] <= 1999:
        ans[4] = 1
    elif 2000 <= A[i] <= 2399:
        ans[5] = 1
    elif 2400 <= A[i] <= 2799:
        ans[6] = 1
    elif 2800 <= A[i] <= 3199:
        ans[7] = 1
    else:
        leng += 1

mi = sum(ans) if sum(ans) > 0 else 1
print(mi, sum(ans) + leng)
import math
A,B = map(int,input().split())
print((A*B)//math.gcd(A,B))

### FIXED CODE ###

import fractions
A,B = map(int,input().split())
print((A*B)//fractions.gcd(A,B))
n, *x = map(int, input().split())
k = 'ABC'
ans = []
s = [input() for _ in range(n)]
for p in range(n):
    sp = s[p]
    if sp == 'AB':
        i = 0
        j = 1
    elif sp == 'BC':
        i = 1
        j = 2
    else:
        i = 0
        j = 2
    if x[i] == x[j] == 0:
        print('No')
        break
    if x[i] == x[j] and i < n - 1:
        sp1 = s[p + 1]
        if k[i] in si1:
            x[i] += 1
            x[j] -= 1
            ans.append(k[i])
        else:
            x[i] -= 1
            x[j] += 1
            ans.append(k[j])
    elif x[i] < x[j]:
        x[i] += 1
        x[j] -= 1
        ans.append(k[i])
    else:
        x[i] -= 1
        x[j] += 1
        ans.append(k[j])
else:
    print('Yes')
    print(*ans, sep='\n')


### FIXED CODE ###

n, *x = map(int, input().split())
k = 'ABC'
ans = []
s = [input() for _ in range(n)]
for p in range(n):
    sp = s[p]
    if sp == 'AB':
        i = 0
        j = 1
    elif sp == 'BC':
        i = 1
        j = 2
    else:
        i = 0
        j = 2
    if x[i] == x[j] == 0:
        print('No')
        break
    if x[i] == x[j] and p < n - 1:
        sp1 = s[p + 1]
        if k[i] in sp1:
            x[i] += 1
            x[j] -= 1
            ans.append(k[i])
        else:
            x[i] -= 1
            x[j] += 1
            ans.append(k[j])
    elif x[i] < x[j]:
        x[i] += 1
        x[j] -= 1
        ans.append(k[i])
    else:
        x[i] -= 1
        x[j] += 1
        ans.append(k[j])
else:
    print('Yes')
    print(*ans, sep='\n')
import math
import sys

a, b, h, m = map(float, input().split())
hour = 30 * h + 0.5 * m
minute = 6 * m

radian = abs(hour - minute)
if radian > 180:
    radian = 360 - abs(hour - minute)

dist = a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(radian))
print(math.sqrt(dist))


### FIXED CODE ###

book_num = int(input())
first_digit = book_num % 10
if first_digit in [2, 4, 5, 7, 9]:
    print('hon')
elif first_digit in [0, 1, 6, 8]:
    print('pon')
else:
    print('bon')
s, t = map(str, input().split())
listS = list(s)
listT = list(t)
sorted(listS)
sorted(listT)
if listS > listT:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input()
t = input()
listS = list(s)
listT = list(t)
listS.sort()
listT.sort(reverse = True)
if listS < listT:
    print("Yes")
else:
    print("No")
# Exercício 15.4-3 - Cormen 3 ed.

s = input()
t = input()
n = len(s) + 1
m = len(t) + 1
c = [[-1] * (m) for x in [-1] * (n)]

def lcsLengthMemoized(s, t, i, j):
    global c
    if c[i][j] != -1:
        return c[i][j]
    if i == 0 or j == 0:
        c[i][j] = 0
        return c[i][j]
    if s[i - 1] == t[j - 1]:
        c[i][j] = lcsLengthMemoized(s, t, i - 1, j - 1) + 1
        return c[i][j]
    c[i][j] = max([lcsLengthMemoized(s, t, i - 1, j), lcsLengthMemoized(s, t, i, j - 1)])
    return c[i][j]
    
def getLCS(c, s, t, i, j, lcs=""):
    if c[i][j] == 0:
        return lcs
    if s[i - 1] == t[j - 1]: # volta uma linha e uma coluna
        lcs += getLCS(c, s, t, i - 1, j - 1, lcs)
        lcs += s[i - 1]
        return lcs
    elif c[i - 1][j] > c[i][j - 1]: # volta uma linha na mesma coluna
        lcs += getLCS(c, s, t, i - 1, j, lcs)
    else: # volta uma coluna na mesma linha
        lcs += getLCS(c, s, t, i, j - 1, lcs)
    return lcs

r = lcsLengthMemoized(s, t, n - 1, m - 1)
print(getLCS(c, s, t, n - 1, m - 1))

### FIXED CODE ###

def main():
    s1, s2 = input(), input()
    n, m = len(s1), len(s2)

    dp, previous = [], []
    for i in range(n + 1):
        dp.append([0] * (m + 1))
        previous.append([0] * (m + 1))

    for row in range(1, n + 1):
        for column in range(1, m + 1):
            if s1[row - 1] == s2[column - 1]:
                dp[row][column] = 1 + dp[row - 1][column - 1]
                previous[row][column] = (row - 1, column - 1)
            else:
                dpUp = dp[row - 1][column]
                dpLeft = dp[row][column - 1]

                if dpUp > dpLeft:
                    dp[row][column] = dpUp
                    previous[row][column] = (row - 1, column)
                else:
                    dp[row][column] = dpLeft
                    previous[row][column] = (row, column - 1)

    lcs = ''
    curr = (n, m)

    while True:
        row, column = curr
        if previous[row][column] == 0: break

        if s1[row - 1] == s2[column - 1]:
            lcs = f'{s1[row - 1]}{lcs}'

        curr = previous[row][column]

    print(lcs)

main()
x,y,z=map(int,input().split(" "))
if z**2-y**2-x**2>2x*y:
	print("Yes")
else:
 
	print("No")

### FIXED CODE ###

import math
x,y,z=map(int,input().split(" "))

if (z-y-x)**2>4*x*y and z>y and z>x:
	print("Yes")
else:
 
	print("No")
import time,sys,io,pprint,math

a = []
while True:
    m,n,o = input()
    m=int(m)
    o=int(o)
    if n == "?":
        break
    if n=="+":
    	a.append(m+o)
    elif n=="-":
    	a.append(m-o)
    elif n=="*":
    	a.append(m*o)
    elif n=="/":
    	a.append(m/o)

for i in a:
	print(a)

### FIXED CODE ###

a = []
while True:
    m,n,o = input().split()
    m=int(m)
    o=int(o)
    if n == "?":
        break
    if n=="+":
    	a.append(m+o)
    elif n=="-":
    	a.append(m-o)
    elif n=="*":
    	a.append(m*o)
    elif n=="/":
    	a.append(int(m/o))
 

for i in a:
	print(i)
ｆｇｈｊ

### FIXED CODE ###

n = int(input())
if n<1000:
    print('ABC')
else:
    print('ABD')
N = int(input())
A = list(map(int,input().split()))
ans = [0]*max(A)

if N ==1:
    ans[0] = 1
else:
    for X in range(max(A)):
        for i in range(N):
            if abs(X-A[i])<=1:
                ans[X]+=1

print(max(ans))

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = [0]*(10**5+3)

for i in range(N):
    ans[A[i]-1] +=1
    ans[A[i]] +=1
    ans[A[i]+1] +=1

print(max(ans))
def main():
    N = int(input())
    la = 2
    lb = 1
    for _ in range(N - 1):
        lc = la + lb
        la = lb
        lb = lc
    print(lc)


main()


### FIXED CODE ###

def main():
    N = int(input())
    la = 2
    lb = 1
    for _ in range(N):
        lc = la + lb
        la = lb
        lb = lc
    print(la)


main()
x = input('>>> ')
if 1 <= x <= 100
    print(x*x*x)

### FIXED CODE ###

x = input()
if 1 <= x <= 100:
    print(x*x*x)
while True:
    a,b=map(int,input().split())
    sum=str(a+b)
    print(len(sum))

### FIXED CODE ###

while True:
    try:
        a,b=map(int,input().split())
    except:
        break
    sum=str(a+b)
    print(len(sum))
s=list(map(str,input()))
price=700

for i in range(s):
  if s[i]=="o":
    price+=100
  else:
    price=price

print(price)

### FIXED CODE ###

S=list(input())
count=0

if S[0]=='o':
  count+=1
if S[1]=='o':
  count+=1
if S[2]=='o':
  count+=1
  
print(count*100+700)
N,M = map(int,input().split())
A = list(map(int,input().split()))

for i in range(M):
    ind = A.index(max(A))
    A[ind] = A[ind]//2

print(sum(A))　　

### FIXED CODE ###

import heapq
N,M = map(int,input().split())
A = list(map(int,input().split()))
for i in range(N):
    A[i] = -A[i]
heapq.heapify(A)

for i in range(M):
    trgt = -heapq.heappop(A)//2
    heapq.heappush(A,-trgt)
print(-sum(A))
#! /usr/bin/env python3

import math


if __name__ == "__main__":
    A, B = input().split()
    print(math.floor(Decimal(A) * Decimal(B)))

### FIXED CODE ###

import math
from decimal import Decimal, getcontext


A, B = input().split()
print(math.floor(Decimal(A) * Decimal(B)))
a=[]
for i in range(5):
  a.append(int(input()))
m={}
for i in range(5):
  if a[i]%10!=0:
    m[a[i]%10]=a[i]
target=m[min(m.keys())]
res=0
for i in range:
  if a[i]==target:
    res+=target
  else:
    res+=math.ceil(a[i]/1)
print(res)

### FIXED CODE ###

a=[int(input()) for i in range(5)]
b=[i-i%10+10 if i%10!=0 else i for i in a]
diff=[y-x for x,y in zip(a,b)]
print(sum(b)-max(diff))
num = int(input())
hats = input()

rhat = len([hat for hat in fats if hat == "R"])
bhat = len([hat for hat in fats if hat == "B"])

if rhat > bhat:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

num = int(input())
hats = input()

rhat = len([hat for hat in hats if hat == "R"])
bhat = len([hat for hat in hats if hat == "B"])

if rhat > bhat:
    print("Yes")
else:
    print("No")
import numpy as np
N = int(input())
h = list(map(int, input().split()))
default = 10000
dp = [default] * N

def rec(i):
  if dp[i] != default:
    return dp[i]
  if i == 0:
    dp[i] = 0
    return 0
  dp[i] = min(dp[i], rec(i-1)+np.abs(h[i] - h[i-1]))
  if i > 1:
    dp[i] = min(dp[i], rec(i-2)+np.abs(h[i] - h[i-2]))
  return dp[i]
print(rec(N-1))

### FIXED CODE ###

import numpy as np
N = int(input())
h = list(map(int, input().split()))
dp = [9999] * N
dp[0] = 0
for i in range(1,N):
  if i<2:
    dp[i] = dp[i-1] + np.abs(h[i] - h[i-1])
  else:
    min1 = dp[i-2] + np.abs(h[i] - h[i-2])
    min2 = dp[i-1] + np.abs(h[i] - h[i-1])
    dp[i] = min(min1, min2)
print(dp[N-1])
from collections import deque

H, W = list(map(int,input().split()))
s = []
for i in range(H):  s.append(input())

dx = [0, 1, -1, 0]
dy = [1, 0, 0, -1]
           
def bfs(sx, sy):
    q = deque([])
    d = [[-1 for _ in range(W)] for _ in range(H)]
    q.append([sx, sy])
    d[sy][sx] = 0
    
    while(q):
        pop = q.popleft()
        x, y = pop[0], pop[1]
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]
            if 0 <= nx and nx < W and ny >= 0 and ny < H:
                if s[ny][nx] != "#" and d[ny][nx] == -1:
                    q.append([nx, ny])
                    d[ny][nx] = d[y][x] + 1
    return d

def max_dim2(d):
    ret = 0
    for i in range(len(d)):
        for j in d[i]:
            ret = max(ret, j)
    return ret

ans = 0
for i in range(H):
    for j in range(W):
        if s[j][i] == ".":
            ret = bfs(i, j)
            temp = max_dim2(ret)
            ans = max(ans, temp)
print(ans)    

### FIXED CODE ###

from collections import deque

H, W = list(map(int,input().split()))
s = []
for i in range(H):  s.append(input())

dx = [0, 1, -1, 0]
dy = [1, 0, 0, -1]
           
def bfs(sx, sy):
    q = deque([])
    d = [[-1 for _ in range(W)] for _ in range(H)]
    q.append([sx, sy])
    d[sx][sy] = 0
    
    while(q):
        pop = q.popleft()
        x, y = pop[0], pop[1]
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]
            if 0 <= nx and nx < H and ny >= 0 and ny < W:
                if s[nx][ny] != "#" and d[nx][ny] == -1:
                    q.append([nx, ny])
                    d[nx][ny] = d[x][y] + 1
    return d

def max_dim2(d):
    ret = 0
    for i in range(len(d)):
        for j in d[i]:
            ret = max(ret, j)
    return ret

ans = 0
for i in range(H):
    for j in range(W):
        if s[i][j] == ".":
            ret = bfs(i, j)
            temp = max_dim2(ret)
            ans = max(ans, temp)
print(ans)
import collections
from math import factorial
N = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(N):
    x = A[i]
    del A[i]
    aa = collections.Counter(A)
    A.insert(i,x)
    for v in aa.values():
        if v >= 2:
            num = factorial(v) / factorial(2) / factorial(v - 2)
            ans += num
    print(int(ans))
    ans = 0

### FIXED CODE ###

from itertools import groupby
import copy

def equalfind(A):
    A.sort()
    s=1
    count=0
    if len(A)==1:
        return count
    else:
        for i in range(0,len(A)-1):
            if A[i]==A[i+1]:
                s+=1
            else:
                count+=s*(s-1)//2
                s=1
        return count+s*(s-1)//2


N=int(input())
A=list(map(int,input().split()))

B=copy.copy(A)
s=equalfind(B)
data=groupby(B)
ans=[0 for i in range(0,N+1)]
for key,group in data:
    g=len(list(group))
    ans[key]=g

for i in range(0,N):
    minus=ans[A[i]]-1
    print(s-minus)