Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import collections
N = int(input())
A_list = list(map(int, input().split(" ")))
C_dic = collections.Counter(A_list)
ans_dic = {}
temp_dic = {}
for i in A_list:
    if i in ans_dic:
        print(ans_dic[i])
    else:
        temp_sum = 0
        for j in C_dic:
            if i == j:
                temp = C_dic[j]-1
                temp = temp*(temp-1)//2
                temp_sum += temp
            else:
                if j in temp_dic:
                    temp_sum += temp_dic[j]
                else:
                    temp = C_dic[j]
                    temp = temp*(temp-1)//2
                    temp_dic[j] = temp
                    temp_sum += temp

        ans_dic[i] = temp_sum
        print(temp_sum)

### FIXED CODE ###

import collections
N = int(input())
A_list = list(map(int, input().split(" ")))
C_dic = collections.Counter(A_list)
ans_dic = {}
sum_cdic = 0
temp_sum = 0
for i in C_dic:
    temp = C_dic[i]
    temp = temp*(temp-1)//2
    temp_sum += temp
sum_cdic = temp_sum

for i in A_list:
    if i in ans_dic:
        print(ans_dic[i])
    else:
        temp_sum = sum_cdic
        temp_sum -= (C_dic[i]*(C_dic[i]-1)//2)
        temp_sum += ((C_dic[i]-1)*(C_dic[i]-2)//2)
        ans_dic[i] = temp_sum
        print(temp_sum)
### BUGGY CODE ###

#164C
#gacha

n=int(input())
l=[]
for i in range(n):
    s=input()
    if s not in l:
        l.append(s)
print(len(l))


### FIXED CODE ###

#164C
#gacha

n=int(input())
l=[]
for i in range(n):
    l.append(input())
    
print(len(set(l)))
### BUGGY CODE ###

n = int(input())

###商及び余りをsとすると、n=m*s+s=s(m+1)、ただし0<s<m
sum_fav = 0
for s in range(1,n):
  if n%s == 0:
    m = n//s-1
    if s < m:
      #print(m)
      sum_fav += m
    else:
      break
  
print(sum_fav)


### FIXED CODE ###

import math

n = int(input())

###商及び余りをsとすると、n=m*s+s=s(m+1)、ただし0<s<m
sum_fav = 0
for s in range(1,int(math.sqrt(n))+1):
  if n%s == 0:
    m = n//s-1
    if s < m:
      #print(m)
      sum_fav += m
    else:
      break
  
print(sum_fav)
### BUGGY CODE ###

times=10**100
S=input()

start=-1
cycle=-1
list_list=[]

clist=[1]*len(S)
list_list.append(clist)

dic_list={}
for i in range(1,10**100):  
  new_clist=[0]*len(S)
  for j,s in enumerate(S):
    if s=="L":
      new_clist[j-1]+=clist[j]
    elif s=="R":
      new_clist[j+1]+=clist[j]

  clist=new_clist
  list_list.append(clist)
  #print(clist)
  
  if str(clist) in dic_list:
    #print(i,i-dic_list[str(clist)],str(clist))
    start=dic_list[str(clist)]
    cycle=i-dic_list[str(clist)]
    break
  else:
    dic_list[str(clist)]=i
    
#print(start,cycle,list_list[start])
index=((10**100-start)%cycle)+start
ans_list=map(str,list_list[index])
print(" ".join(ans_list))

### FIXED CODE ###

S=input()
ans_list=[0]*len(S)

rmode=True
cnt_R=0
cnt_L=0
border_R=0
border_L=0
for i in range(len(S)):
  if rmode:
    if S[i]=="R":
      cnt_R+=1
    else:
      border_R=i-1
      border_L=i      
      rmode=False
      cnt_L=1
  else:
    if S[i]=="L":
      cnt_L+=1
    else:
      ans_list[border_R]+=(cnt_R+1)//2
      ans_list[border_L]+=cnt_R//2
      ans_list[border_R]+=cnt_L//2
      ans_list[border_L]+=(cnt_L+1)//2
      rmode=True
      cnt_R=1
      cnt_L=0
else:
  ans_list[border_R]+=(cnt_R+1)//2
  ans_list[border_L]+=cnt_R//2
  ans_list[border_R]+=cnt_L//2
  ans_list[border_L]+=(cnt_L+1)//2
  
      
ans_list_str=map(str,ans_list)
print(" ".join(ans_list_str))
### BUGGY CODE ###

from collections import Counter

def main():
    N = int(input())
    A = list(map(int, input().split()))
    uq = list(set(A))
    ans_hash = {}
    for u in uq:
        ans = 0
        a = A[:]
        i = a.index(u)
        del a[i]
        C = Counter(a)
        val = C.values()
        for num in val:
            ans += num * (num - 1) // 2
        ans_hash[u] = ans
    for n in A:
        print(ans_hash[n])


if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import Counter

def choose(n):
    return n * (n - 1) // 2


def main():
    N = int(input())
    A = list(map(int, input().split()))
    C = Counter(A)
    cnt = 0
    for c in C.values():
        cnt += choose(c)

    for a in A:
        ans = cnt
        ans -= choose(C[a])
        ans += choose(C[a] - 1)
        print(ans)


if __name__ == '__main__':
    main()
### BUGGY CODE ###

# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

N,C = map(int,input().split())
tv_times = [[int(j) for j in input().split()] for i in range(N)]
# print(tv_times)
for i in range(N):
    for j in range(i,N):
        if tv_times[i][2] == tv_times[j][2]:
            if tv_times[i][0] == tv_times[j][1] or tv_times[i][1]==tv_times[j][0]:
                tv_times[i][0] = min(tv_times[i][0],tv_times[j][0])
                tv_times[i][1] = max(tv_times[i][1],tv_times[j][1])
                tv_times[j][0] = 0
                tv_times[j][1] = 0

max_end = -1
# print(tv_times)
for i in range(N):
    max_end = max(tv_times[i][1],max_end)

# print(max_end)
count = [0 for i in range(max_end)]
for ni in range(N):
    for time in range(max(tv_times[ni][0]-1,0),tv_times[ni][1]):
        count[time] += 1

# print(count)
print(max(count))


"""
[S-1~T]

Q1
3 2
1 7 2
7 8 1
8 12 1


つまり
0.5~7
6.5~8
7.5~12
"""


### FIXED CODE ###

N,C = map(int,input().split())
tv_times = [[int(j) for j in input().split()] for i in range(N)]

channells = {}
for i in range(C+1):
    channells[i] = []
max_end = -1

for i in range(N):
    s,g,c = tv_times[i]
    max_end = max(max_end,g)
    channells[c] += [s,g]

tv_times = []
f = [0 for i in range(max_end+1)]
for cha in channells.keys():
    remove_list = []
    time = channells[cha]
    time.sort()
    for i in range(1,len(time)-1):
        if time[i] == time[i+1]:
            remove_list.append(time[i])
    time = list(set(time)-set(remove_list))
    time.sort()
    for i in range(len(time)//2):
        f[max(time[2*i]-1,0)] += 1
        f[time[2*i+1]] -= 1
ans = -1
for i in range(1,max_end+1):
    f[i] += f[i-1]
    if ans < f[i]:
        ans = f[i]

print(ans)
### BUGGY CODE ###

N = int(input())
slist = []
for i in range(N):
    slist.append(sorted(list(input())))
count = [0 for i in range(N)]
c = []
answer = 0
for i in range(N):
    d = 0
    for j in range(len(c)):
        if slist[i] == c[j]:
            count[j] += 1
            answer += count[j]
            d = 1
    if d == 0:
        c.append(slist[i])
print(answer)

### FIXED CODE ###

N = int(input())
ssorted = []
for i in range(N):
    ssorted.append("".join(sorted(list(input()))))
sdict = {}
for i in ssorted:
    if i in sdict:
        sdict[i] += 1
    else:
        sdict[i] = 1
count = 0
for i in sdict:
    s = sdict[i]
    if s >= 2:
        count += s*(s-1)//2
print(count)
### BUGGY CODE ###

import sys
n = int(input())
d = []
for op in sys.stdin.readlines():
    op = op.split()
    if op[0] == 'insert':
        d.append(op[1])  
    elif op[0] == 'find':
        if op[1] in d:
            print('yes')
        else:
            print('no')

### FIXED CODE ###

import sys
n = int(input())
d = {}
for op in sys.stdin.readlines():
    op = op.split()
    if op[0] == 'insert':
        d[op[1]] = 1  
    elif op[0] == 'find':
        if op[1] in d:
            print('yes')
        else:
            print('no')
### BUGGY CODE ###

import itertools

N,K=list(map(int,raw_input().split()))
x=[]
y=[]
for i in range(N):
	a1,a2=map(int,raw_input().split())
	x.append(a1)
	y.append(a2)
#print x
#print y


ans=100000000000000000000
for i in range(N):
	for j in range(N):
		for k in range(N):
			for l in range(N):
				cnt=0
				for m in range(N):
					x_t=x[m]
					y_t=y[m]
					if (x_t>=x[i] and x_t<=x[j]) or (x_t>=x[j] and x_t<=x[i]):
						if (y_t>=y[k] and y_t<=y[l]) or (y_t>=y[l] and y_t<=y[k]):
							cnt+=1
				#print cnt
				if cnt>=K:
					#print x[i],y[k],x[j],y[l],cnt,abs(x[i]-x[j])*abs(y[k]-y[l])
					ans=min(ans,abs(x[i]-x[j])*abs(y[k]-y[l]))


print ans

### FIXED CODE ###

import itertools

N,K=list(map(int,raw_input().split()))
x=[]
y=[]
pts=[]
for i in range(N):
	a1,a2=map(int,raw_input().split())
	x.append(a1)
	y.append(a2)
	pts.append([a1,a2])

#print "# x,y"
x.sort()
y.sort()
#print x
#print y

#print "# pts"
#print pts
pts.sort(key=lambda x:x[0])
#print pts

ans=10**20


for y1 in y:
	for y2 in y:
		if y1>=y2:
			continue
		for x1 in x:
			cnt=0
			for p in pts:
				if p[0]>=x1 and p[1]>=y1 and p[1]<=y2:
					#print p[0],p[1],x1,y1,y2
					cnt+=1
					if cnt==K:
						x2=p[0]
						#print x1,y1,x2,y2,cnt,abs(x2-x1)*abs(y2-y1)
						ans=min(ans,abs(x2-x1)*abs(y2-y1))
						break

print ans
### BUGGY CODE ###

import math
N=int(input())
Candidate=-(-math.sqrt(N)//1)
while N%Candidate!=0:
    if Candidate>N:
        break
    Candidate+=1
print(len(str(Candidate))-2)

### FIXED CODE ###

import math
N=int(input())
Candidate=-(-math.sqrt(N)//1)
while N%Candidate!=0:
    Candidate-=1
Candidate=N/Candidate
print(len(str(Candidate))-2)
### BUGGY CODE ###

import bisect
a,b,n = map(int,input().split())

x = list()
if n<=b:
  for i in range(n+1):
    y = int(a*i/b) - a*int(i/b)
    x.insert(bisect.bisect_left(x,y),y)
else:
  for i in range(b):
    y = int(a*i/b) - a*int(i/b)
    x.insert(bisect.bisect_left(x,y),y)

print(x[-1])


### FIXED CODE ###

a,b,n=map(int,input().split())
x=min(b-1,n)
print((a*x)//b-a*(x//b))
### BUGGY CODE ###

N = int(input())

line_list = []
line_num = []

for i in range(N):
    temp = input()
    if temp in line_list:
        line_num[line_list.index(temp)] += 1
    else:
        line_list.append(temp)
        line_num.append(1)
        
maxs = []

for i in range(len(line_list)):
    if line_num[i] == max(line_num):
        maxs.append(line_list[i])
        
maxs.sort()
for i in range(len(maxs)):
    print(maxs[i])

### FIXED CODE ###

# coding cell (SUBMIT ONLY THIS CELL)

N = int(input())

counter = {}

for i in range(N):
    temp = input()
    if temp not in counter:
        counter.update({temp : 1})
    else:
        counter.update({temp : counter[temp] + 1})

m = max(counter.values())
        
ans = []    

for a,b in counter.items():
    if b == m:
        ans.append(a)
    
ans.sort()

for i in ans:
    print(i)
### BUGGY CODE ###

import math
N=int(input())

n=math.floor(math.sqrt(N))

for n in range(1,N+1):
    ans=0
    for x in range(1,n ):
        for y in range(1, n):
            for z in range(1, n):
                if x**2+y**2+z**2+x*y+y*z+z*x==n:
                        ans+=1
    print(ans)

### FIXED CODE ###

n=int(input())
ans=[0 for _ in range(10001)]

for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      v=x*x+y*y+z*z+x*y+y*z+z*x
      if v<10001:
        ans[v]+=1

for i in range(n):
  print(ans[i+1])
### BUGGY CODE ###

def floor(a, b, x):
    ans = (a * x // b) - a * (x // b)
    return ans

a,b,n=map(int,input().split())
max = 0
if b - 1 > n:
    x = n
else:
    x = b - 1

while x <= n:
    tmp = floor(a,b,x)
    if max < tmp: max = tmp
    x += b

print(max)

### FIXED CODE ###

a,b,n=map(int,input().split())

max = 0
if b - 1 > n:
    x = n
else:
    x = b - 1

max = (a * x // b) - a * (x // b)

print(max)
### BUGGY CODE ###

n = input()
A = input().split(' ')
A.sort()
A.reverse()
q = input()
M = input().split(' ')

A = list(map(int,A))
M = list(map(int,M))

#memo = [True]*(len(A))

def search(base, m, n):
    if base == m:
        return True
    result = False
    for i in range(n,len(A)):
        if base + A[i] <= m: # and memo[i]:
#           memo[i] = False
#           print(str(A[i]) + ',' + str(base+A[i]) + ',')
            if search(base+A[i], m, i+1):
                return True
#           memo[i] = True
    return result

def print_yn(result):
    if result:
        print('yes')
    else:
        print('no')

for m in M:
#   print(str(m)+':')
    print_yn(search(0,m,0))

### FIXED CODE ###

n = input()
A = input().split(' ')
A.sort()
A.reverse()
q = input()
M = input().split(' ')

A = list(map(int,A))
M = list(map(int,M))
A.sort()

A_sum = [0]
for a in A:
    A_sum.append(a+A_sum[-1])
A_sum.pop(0)

A.reverse()
A_sum.reverse()


#memo = [True]*(len(A))

def search(base, m, n):
    if base == m:
        return True
    if len(A)-1 < n or m - base > A_sum[n]:
        return False
    result = False
    for i in range(len(A)-1,n-1,-1):
        if base + A[i] <= m: # and memo[i]:
#           memo[i] = False
#           print(str(A[i]) + ',' + str(base+A[i]) + ',')
            if search(base+A[i], m, i+1):
                return True
#           memo[i] = True
    return result

def print_yn(result):
    if result:
        print('yes')
    else:
        print('no')

for m in M:
#   print(str(m)+':')
    print_yn(search(0,m,0))
### BUGGY CODE ###

N, M = map(int, input().split())

war = {}
for i in range(M):
    a, b = map(int, input().split())
    if(b in war):
        if(a > war[b]):
            war[b] = a
    else:
        war[b] = a

ans = 1
b_list = list(war.keys())
b_list = sorted(b_list)
r_bridge = b_list[0] - 1

while(True):
    # print(b_list)
    for b in b_list[:]:
        a = war[b]
        if(a <= r_bridge < b):
            b_list.remove(b)

    if(b_list != []):
        r_bridge = b_list[0] - 1
        ans += 1
    else:
        break

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())

war = {}
for i in range(M):
    a, b = map(int, input().split())
    if(b in war):
        if(a > war[b]):
            war[b] = a
    else:
        war[b] = a

ans = 1
b_list = list(war.keys())
b_list = sorted(b_list)
r_bridge = b_list[0] - 1

for b in b_list:
    a = war[b]
    if(a <= r_bridge):
        continue
    else:
        r_bridge = b - 1
        ans += 1

print(ans)
### BUGGY CODE ###

import collections
import heapq


class Dijkstra():
    def __init__(self):
        self.e = collections.defaultdict(list)

    def add(self, u, v, d, directed=False):
        """
        #0-indexedでなくてもよいことに注意
        #u = from, v = to, d = cost
        #directed = Trueなら、有向グラフである
        """
        if directed is False:
            self.e[u].append([v, d])
            self.e[v].append([u, d])
        else:
            self.e[u].append([v, d])

    def delete(self, u, v):
        self.e[u] = [_ for _ in self.e[u] if _[0] != v]
        self.e[v] = [_ for _ in self.e[v] if _[0] != u]

    def search(self, s):
        """
        #0-indexedでなくてもよいことに注意
        #:param s: 始点
        #:return: 始点から各点までの最短経路と最短経路を求めるのに必要なprev
        """
        d = collections.defaultdict(lambda: float('inf'))
        prev = collections.defaultdict(lambda: None)
        d[s] = 0
        q = []
        heapq.heappush(q, (0, s))
        v = collections.defaultdict(bool)
        while len(q):
            k, u = heapq.heappop(q)
            if v[u]:
                continue
            v[u] = True

            for uv, ud in self.e[u]:
                if v[uv]:
                    continue
                vd = k + ud
                if d[uv] > vd:
                    d[uv] = vd
                    prev[uv] = u
                    heapq.heappush(q, (vd, uv))

        return d

    def getDijkstraShortestPath(self, start, goal):
        _, prev = self.Dijkstra_search(start)
        shortestPath = []
        node = goal
        while node is not None:
            shortestPath.append(node)
            node = prev[node]
        return shortestPath[::-1]
        
n, x, y = map(int,input().split())
ans = collections.defaultdict(int)

edges = [[i, i+1, 1] for i in range(1, n)]
edges += [[x, y, 1]]

graph1 = Dijkstra()

for u, v, a in edges:
    graph1.add(u,v,a)

for i in range(1,n+1):
    result_a = graph1.search(i)
    for j in range(i+1, n+1):
        ans[result_a[j]] += 1

for i in range(1,n-1):
    print(ans[i])
print(0)

### FIXED CODE ###

n, x, y = map(int,input().split())

ans = [0] * (n+10)

for i in range(1, n+1):
    for j in range(i+1, n+1):
        distance = min(abs(j-i), abs(x-i) + 1 + abs(y-j), abs(y-i) + 1 + abs(x-j))
        ans[distance] += 1
        
for i in range(1, n):
    print(ans[i])
### BUGGY CODE ###

N=int(input())
for i in range(1,N+1):
  cnt=0
  for x in range(1,N-2):
    for y in range(1,N-x+1):
      for z in range(1,N-x-y+1):
        if i==x**2+y**2+z**2+x*y+y*z+z*x:
          cnt+=1
  print(cnt)
      


### FIXED CODE ###

import sys
input = sys.stdin.readline
import math

N=int(input())
ans=[0]*(N+1)
sn=int(math.sqrt(N)+1)
for x in range(1,sn+1):
  for y in range(1,sn+1):
    for z in range(1,sn+1):
      i=x**2+y**2+z**2+x*y+y*z+z*x
      if 1<=i<=N:
        ans[i]+=1
for h in range(1,N+1):          
  print(ans[h])
### BUGGY CODE ###

N, M = map(int, input().split())
A = list(input().split())
A = [int(i) for i in A]
A.sort(reverse=True)

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

print(sum(A))

### FIXED CODE ###

import heapq

N, M = map(int, input().split())
A = list(input().split())
A = [int(i) * (-1) for i in A]

heapq.heapify(A)

for _ in range(M):
    val = heapq.heappop(A)
    heapq.heappush(A, val*(-1)//2*(-1))

print(sum(A) * (-1))
### BUGGY CODE ###

import sys
import numpy

N, X = map(int, input().split())
x_list = list(map(int, input().split()))
x_list.insert(0, 0)

sum_x = numpy.cumsum(x_list)

max_robo = -(-1 * N // 2)
ans = sys.maxsize
for k in range(1, max_robo + 1):
    t_ans = (N + k) * X
    t_ans += 5 * sum_x[N]
    for j in range(1, -(-(N - k) // k)):
        t_ans += 2 * sum_x[N - (j + 1) * k]

    ans = min(ans, t_ans)

print(ans)

### FIXED CODE ###

import sys
# import numpy

N, X = map(int, input().split())
x_list = list(map(int, input().split()))
x_list.insert(0, 0)

tmp = 0
sum_x = []
for x in x_list:
    tmp += x
    sum_x.append(tmp)
# sum_x = numpy.cumsum(x_list)

max_robo = -(-1 * N // 2)
ans = sys.maxsize
for k in range(1, max_robo + 1):
    t_ans = (N + k) * X + 5 * sum_x[N]
    for j in range(1, -(-(N - k) // k)):
        t_ans += 2 * sum_x[N - (j + 1) * k]

    ans = min(ans, t_ans)

print(ans)
### BUGGY CODE ###

N = int(input())
S = input()
import numpy as np
ans = 0
for i in range(0, N):
    for j in range(i, N):
        if i ==j or S[i] == S[j]:
            continue
        s = ['R', 'G', 'B']
        s.remove(S[i])
        s.remove(S[j])
        k_s = np.where(np.array(list(S[j:])) == s[0])[0] + j
        for k in k_s:
            if j == k or S[j] == S[k]:
                continue
            elif j-i != k-j and S[i] != S[k]:
                ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
S = input()
ans = S.count("R") * S.count("G") * S.count("B")
for i in range(N):
    for j in range(i + 1, N):
        k = j - i + j
        if k < N:
            if {S[i], S[j], S[k]} == {"R", "G", "B"}:
                ans -= 1
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.buffer.readline
from operator import itemgetter

def main():
    N,T = map(int,input().split())
    delay = 0
    food = []
    for _ in range(N):
        a,b = map(int,input().split())
        food.append((a,b))
        delay = max(delay,a)
        
    dp = [0 for _ in range(T+delay)]
    food.sort(key = itemgetter(0))
    
    for a,b in food:
        for i in reversed(range(T)):
            dp[i+a] = max(dp[i+a],dp[i]+b)

    print(max(dp[T:]))
    
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline
from operator import itemgetter
import numpy as np

def main():
    N,T = map(int,input().split())
    food = []
    for _ in range(N):
        a,b = map(int,input().split())
        food.append((a,b))
        
    dp = np.zeros(T,dtype=int)
    food.sort(key = itemgetter(0))
    
    ans = 0
    for a,b in food:
        ans = max(ans,dp[-1]+b)
        dp[a:] = np.maximum(dp[a:],dp[:-a]+b)

    print(ans)
    
if __name__ == "__main__":
    main()
### BUGGY CODE ###

n = int(input())
v = list(map(int, input().split()))
v1 = []
v2 = []
ans = 0

for i in range(n):
    if i % 2 == 0:
        v1.append(v[i])
    else:
        v2.append(v[i])

mostCount1 = 0
mostChar1 = 0
dp1 = [None] * (n//2)

for i in range(n//2):
    count = 0
    if dp1[i] is not None:
        count = dp1[i]
    else:
        dp1[i] = v1.count(v1[i])
        count = dp1[i]
#    count = v1.count(v1[i])
    if count > mostCount1:
        mostCount1 = count
        mostChar1 = v1[i]
        if mostCount1 > n//2:
            break

mostCount2 = 0
mostChar2 = 0
dp2 = [None] * (n//2)

for i in range(n//2):
#    count = v2.count(v2[i])
    count = 0
    if dp2[i] is not None:
        count = dp2[i]
    else:
        dp2[i] = v2.count(v2[i])
        count = dp2[i]

    if count > mostCount2:
        mostCount2 = count
        mostChar2 = v2[i]
        if mostCount2 > n//2:
            break

if mostChar1 == mostChar2:
    ans = n//2
else:
    ans = n - mostCount1 - mostCount2

print(ans)



### FIXED CODE ###

import collections

n = int(input())
v = list(map(int, input().split()))
v1 = []
v2 = []
ans = 0

for i in range(n):
    if i % 2 == 0:
        v1.append(v[i])
    else:
        v2.append(v[i])

c1 = collections.Counter(v1)
mostChar1, mostCount1 = c1.most_common()[0]
#ndChar1, ndCount1 = c1.most_common()[1]

c2 = collections.Counter(v2)
mostChar2, mostCount2 = c2.most_common()[0]
#ndChar2, ndCount2 = c2.most_common()[1]

if mostChar1 == mostChar2:
    if len(c1.most_common()) == 1 and len(c1.most_common()) == 1:
        ans = n // 2
    elif len(c1.most_common()) == 1:
        ndChar2, ndCount2 = c2.most_common()[1]
        ans = n - mostCount1 - ndCount2
    elif len(c2.most_common()) == 1:
        ndChar1, ndCount1 = c1.most_common()[1]
        ans = n - mostCount2 - ndCount1
    else:
        ndChar1, ndCount1 = c1.most_common()[1]
        ndChar2, ndCount2 = c2.most_common()[1]
        temp1 = n - mostCount1 - ndCount2
        temp2 = n - mostCount2 - ndCount1
        ans = min(temp1, temp2)
else:
    ans = n - mostCount1 - mostCount2

print(ans)
### BUGGY CODE ###

import sys

x=int(input())
a=1
while(1):
    if(a+1)**5>x:
        break
    a+=1
b=0
s=0
while(1):
    while(1):
        if(a==b):
            break
        if x%(a-b)==0:
            A=a**5
            B=b**5
            k=x-A
            if(-B==k):
                print(a,b)
                sys.exit()
            elif (B==k):
                print(a,-b)
                sys.exit()
        b+=1
    a+=1

### FIXED CODE ###

import sys

x=int(input())
for i in range(-120,120):
    for j in range(-120,120):
        if(i**5-j**5==x):
            print(i,j)
            sys.exit()
### BUGGY CODE ###

N, A, B = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)


def enough(T):
    num = 0
    for i in range(N):
        if H[i] - B * T > 0:
            num += (H[i] - B * T) // (A - B)
            num += int((H[i] - B * T) % (A - B) != 0)
    return T >= num


left, right = 0, 10 ** 9 + 1
mid = (left + right) // 2
while right - left > 1:
    mid = (left + right) // 2
    if enough(mid):
        right = mid
    else:
        left = mid

print(right)

### FIXED CODE ###

N, A, B = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)


def enough(T):
    num = 0
    for i in range(N):
        if H[i] - B * T > 0:
            num += (H[i] - B * T) // (A - B)
            num += int((H[i] - B * T) % (A - B) != 0)
    return T >= num


left, right = 0, 10 ** 9 + 1
mid = (left + right) // 2
while right - left > 1:
    mid = (left + right) // 2
    if enough(mid):
        right = mid
    else:
        left = mid

print(right)