Harryxun/stf_run huggingface dataset:
N , X =map(int,input().split())
sums = []
i = X
result =[]
for i in range(N):
    sums.append(i+X)
for j in range(N):
    result.append(sum(sums)-sums[j]*2 )
for k in range(N):
    if sum(sums) == result[k]:
        print(result[k])
    else:
        print(abs(min(result[k])))


### FIXED CODE ###

N , X =map(int,input().split())
sums = []
i = X
result =[]
a = []
for i in range(N):
    sums.append(i+X)
for j in range(N):
    a.append(abs(sums[j]))

if sum(sums) ==abs(sum(sums)):
    print(sum(sums) - min(a))
else :
    print(sum(sums) + min(a))
n = input()

A = {}
A = map(int, raw_input().split())
 
q = input()
 
m = map(int, raw_input().split())

def solve(i, m):
  if m == 0:
    return True
  if i >= n:
    return False
  res = solve(i, m) or solve(i, m - A[i])
  return res


for i in m:
  if solve(0,i):
    print "yes"
  else:
    print "no"

### FIXED CODE ###

n = input()

A = map(int, raw_input().split())
   
q = input()
   
M = map(int, raw_input().split())
  
def solve(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  res = solve(i+1, m) or solve(i+1, m - A[i])
  return res
  
  
for m in M:
  if solve(0,m):
    print "yes"
  else:
    print "no"
a = [input() for i in range(N)]
for i in range(len(a)):
    if(a[i]==0):
        break
    else:
        print(a[i])

### FIXED CODE ###

i=1
while(1):
    n=input()
    if(int(n)==0):
        break
    else:
        print('Case '+str(i)+': '+n)
        i+=1
N,M=map(int,input().split)

if N==M:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

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

if N==M:
  print("Yes")
else:
  print("No")
#<D>wa
#(Point)
#優先度付きキューを使いこなす！
#最大値を1/2するのをＭ回繰り返せばいいけどリストやと最大値の選定にO(N),
#それをＭ回やからO(MN)でＴＬＥ
#heapqやったらO(MlogN)なのでおｋ
import heapq
N, M = map(int,input().split())
#最大値取り出すためにリストの要素をすべてマイナスに
A = list(map(lambda x:-int(x),input().split()))
heapq.heapify(A) #Ａを優先度付きキューに

for i in range(M):
    value_min = heapq.heappop(A)
    heapq.heappush(A, (-1) * (-value_min//2)) #負数の剰余演算避けるために
    #一時的に０以上の整数にしている
    #*(-1)してやらんと挿入した後の次の最大値を探す作業ができなくなる
    #heapqは最小値しかみつけれんから
    print(A)
print(-sum(A))



### FIXED CODE ###

#<D>wa
#(Point)
#優先度付きキューを使いこなす！
#最大値を1/2するのをＭ回繰り返せばいいけどリストやと最大値の選定にO(N),
#それをＭ回やからO(MN)でＴＬＥ
#heapqやったらO(MlogN)なのでおｋ
import heapq
N, M = map(int,input().split())
#最大値取り出すためにリストの要素をすべてマイナスに
A = list(map(lambda x:-int(x),input().split()))
heapq.heapify(A) #Ａを優先度付きキューに

for i in range(M):
    value_min = heapq.heappop(A)
    heapq.heappush(A, (-1) * (-value_min//2)) #負数の剰余演算避けるために
    #一時的に０以上の整数にしている
    #*(-1)してやらんと挿入した後の次の最大値を探す作業ができなくなる
    #heapqは最小値しかみつけれんから
    #print(A)
print(-sum(A))
buffer = list(input())
S = list(map(int, buffer))
N = len(S)
i = 0
count = 0
while(1):
    if(S == [] or N == 1):
        break
    elif((S[i] + S[i + 1]) == 1):
        S.pop(i)
        S.pop(i)
        i = i - 1
        count += 2
        N = len(S)
    else:
        i += 1
        if(i == (N - 1)):
            break
print(count)

### FIXED CODE ###

S = list(input())
count_bule = S.count('0')
count_red = S.count('1')
count_min = min(count_bule, count_red)
print(2 * count_min)
A,B,H,M =int(input("A :")),int(input("B :")),int(input("H :")),int(input("M :"))
if 1<=A<=1000 and 1<=B<=1000 and 0<=H<=11 and 0<=M<=59:
    #hw=(2*math.pi)/(12*60*60) #時針の角速度[rad/s]
    #mw=(2*math.pi)/(60*60) #分針の角速度[rad/s]
    #time_h=H*60*60 #Hour時間[s] 
    #time_m=M*60 #Min時間[s]
    hw=(2*math.pi)/12
    mw=(2*math.pi)/60
    aw=hw*(H+M) #Arad[rad] #最後の鬼門だった！！なるほどね！40min経ってる間に時針も進んでるから。。
    bw=mw*M #Brad[rad]
    rad=abs(bw-aw)
    # 正弦定理で出力結果を得る(a^2=b^2+c^2-2bccosθ)
    print(math.sqrt(A**2+B**2-2*A*B*math.cos(rad)))
    #確認用
    #print(time_h,time_m,aw,bw,rad) 
else: 
    print("各値の条件は次の通り:1<=A,B<=1000,0<=H<=11,0<=M<=59")
    print("あなたの入力:A={},B={},H={},M={}".format(A,B,H,M))

### FIXED CODE ###

import math

A,B,H,M =map(int, input().split())
if 1<=A<=1000 and 1<=B<=1000 and 0<=H<=11 and 0<=M<=59:
    hw=(2*math.pi)/(12*60*60) #時針の角速度[rad/s]
    mw=(2*math.pi)/(60*60) #分針の角速度[rad/s]
    time_h=H*60*60 #Hour時間[s] 
    time_m=M*60 #Min時間[s]
    aw=hw*(time_h+time_m) #Arad[rad] #最後の鬼門だった！！なるほどね！40min経ってる間に時針も進んでるから。。
    bw=mw*time_m #Brad[rad]
    rad=abs(bw-aw)
    # 正弦定理で出力結果を得る(a^2=b^2+c^2-2bccosθ)
    print(math.sqrt(A**2+B**2-2*A*B*math.cos(rad)))
    #確認用
    #print(time_h,time_m,aw,bw,rad) 
else: 
    print("各値の条件は次の通り:1<=A,B<=1000,0<=H<=11,0<=M<=59")
    print("あなたの入力:A={},B={},H={},M={}".format(A,B,H,M))
N,M = map(int,input().split())
string = ""
if N>M:
    for i in range(N):
        string = string+str(M)
elif b>a:
    for i in range(M):
        string = string+str(N)
else:
    for i in range(N):
        string =  string+str(N)
print(string)



### FIXED CODE ###

a,b = input().split()
a = int(a)
b = int(b)
string = ""
if a>b:
    for i in range(a):
        string = string+str(b)
elif b>a:
    for i in range(b):
        string = string+str(a)
else:
    for i in range(a):
        string =  string+str(a)
print(string)
x = int(input())
y = list(map(int, input().split(" ")))

for i in range(x - 1):
  if y[i] < 0:
    y[i] *=-1
    y[i + 1] *=-1

if y[-1] < 0:
  y[-1] *= -1
  y[y.index(min(y[0:-2]))] *= -1
  
print(sum(y))

### FIXED CODE ###

x = int(input())
y = list(map(int, input().split(" ")))

for i in range(x - 1):
  if y[i] < 0:
    y[i] *=-1
    y[i + 1] *=-1

if y[-1] < 0 and abs(min(y[0:-1])) < abs(y[-1]) :
  y[-1] *= -1
  y[y.index(min(y[0:-1]))] *= -1

print(sum(y))
s = input()

if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print(Rainy)
else:
    print('Sunny')


### FIXED CODE ###

s = input()

if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')
a,b,c=input().split()
e,f,g=input().split()
if a==g and c==e and b==f:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

a=input()
b=input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print('YES')
else:
  print('NO')
# -*- coding: utf-8 -*-
# Input#
n = int(input())
# n, k = map(int, input().split())
h = list(map(int, input().split()))

h = [-1] + h

ans = 0

memo = [-1] * (n + 1)
memo[1] = 0
memo[2] = abs(h[2] - h[1])


def dp(i):
    if memo[i] != -1:
        return memo[i]
    else:
        hop1 = dp(i - 1) + abs(h[i] - h[i - 1])
        hop2 = dp(i - 2) + abs(h[i]) - h[i - 2]
        return min(hop1, hop2)


ans = dp(n)
print("{}".format(ans))


### FIXED CODE ###

# -*- coding: utf-8 -*-
# Input#
n = int(input())
# n, k = map(int, input().split())
h = list(map(int, input().split()))

h = [-1] + h

ans = 0

memo = [-1] * (n + 1)
memo[1] = 0
memo[2] = abs(h[2] - h[1])


def dp(i):
    if memo[i] != -1:
        return memo[i]
    else:
        hop1 = dp(i - 1) + abs(h[i] - h[i - 1])
        hop2 = dp(i - 2) + abs(h[i] - h[i - 2])
        memo[i] = min(hop1, hop2)
        return memo[i]


for i in range(n):
    if i == 0 or i == 1 or i == 2:
        continue
    hop1 = memo[i - 1] + abs(h[i] - h[i - 1])
    hop2 = memo[i - 2] + abs(h[i] - h[i - 2])
    memo[i] = min(hop1, hop2)

ans = dp(n)

print("{}".format(ans))
Sa = input()
Sb = input()
Sc = input()
flg=True
nxt = "a"
while flg:
    if nxt=="a":
        if len(Sa)==0:
            flg=False
            winner = "A"
        nxt = Sa[0]
        Sa=Sa[1:]
    elif nxt=="b":
        if len(Sb)==0:
            flg=False
            winner = "B"
        nxt = Sb[0]
        Sb=Sb[1:]
    elif nxt=="c":
        if len(Sc)==0:
            flg=False
            winner = "C"
        nxt = Sc[0]
        Sc=Sc[1:]

print(winner)

### FIXED CODE ###



Sa = input()
Sb = input()
Sc = input()
flg=True
nxt = "a"
while flg:
    if nxt=="a":
        if len(Sa)==0:
            winner = "A"
            break
        nxt = Sa[0]
        Sa=Sa[1:]
    elif nxt=="b":
        if len(Sb)==0:
            winner = "B"
            break
        nxt = Sb[0]
        Sb=Sb[1:]
    elif nxt=="c":
        if len(Sc)==0:
            winner = "C"
            break
        nxt = Sc[0]
        Sc=Sc[1:]

print(winner)
import sys
import math
input = sys.stdin.buffer.readline
def lcm(x,y):
  return((x*y)//math.gcd(x,y))
def main():
  N=int(input())
  arr=list(map(int,input().split()))
  MOD=1000000007 
  LCM=1
  for i in arr:
    LCM=lcm(LCM,i)
  ans=0
  for i in arr:
    ans += LCM//i
  print(ans%MOD)
if __name__=="__main__":
  main()

### FIXED CODE ###

import sys
import fractions
input = sys.stdin.buffer.readline
def lcm(x,y):
  return((x*y)//fractions.gcd(x,y))
def main():
  N=int(input())
  arr=list(map(int,input().split()))
  MOD=1000000007 
  LCM=1
  for i in arr:
    LCM=lcm(LCM,i)
  ans=0
  for i in arr:
    ans += LCM//i
  print(ans%MOD)
if __name__=="__main__":
  main()
a,b=map(input().split())
if a=='H':
  print(b)
elif b=='H':
  print('D')
else:
  print('H')

### FIXED CODE ###

a,b=map(str,input().split())
if a=='H':
  print(b)
elif b=='H':
  print('D')
else:
  print('H')
n = int(input())
list = []
for i in range(0,n):
  list.append(int(input()))
  
new_list = sorted(list, reverse=True)
print lst in new_list:
  print(lst)

### FIXED CODE ###

n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a) # sortする降順に

for a in a:print(b[(a<b[-1])-2])
N = int(input())
A = list()
cnt = 0
A.append(input())
for i in range(N-1):
  x = input()
  if x in A:
    cnt = 1
  elif A[i][-1:] != x[0]:
    cnt = 1
  else:
    A.append(x)
print('Yes' if cnt == 0 else 'No')

### FIXED CODE ###

N = int(input())
A = list()
cnt = 0
A.append(input())
for i in range(N-1):
  x = input()
  if x in A:
    cnt = 1
  elif A[i][-1:] != x[0]:
    cnt = 1
  A.append(x)
print('Yes' if cnt == 0 else 'No')
cin=input().split()
N=int(cin[0])
M=int(cin[1])


result={}
ac=0
wa=0
for i in range(M):
    cin=input().split()
    p=int(cin[0])
    S=str(cin[1])

    log=result.get(p,None)
    if S == "AC" and log != "AC":
        ac+=1
        result[p]="AC"

    if S == "WA" and log != "AC":
        wa+=1

print(f"{ac} {wa}")

### FIXED CODE ###

a=ord(str(input())[0])

print(chr(a+1))
def iteraccumulate(l):
    from itertools import accumulate
    return list(accumulate(l))


def resolve():
    from bisect import bisect_right
    n, m, k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    aa = [0] + iteraccumulate(a)
    bb = iteraccumulate(b)
    lbb = len(bb)
    ans = 0
    for index, i in enumerate(aa):
        j = bisect_right(bb, k - i)
        if i + bb[j - 2] <= k:
            ans = max(ans, index + j - 1)
        if i + bb[j - 1] <= k:
            ans = max(ans, index + j)
        if j < lbb and i + bb[j] <= k:
            ans = max(ans, index + j + 1)
    print(ans)


if __name__ == '__main__':
    resolve()


### FIXED CODE ###

def iteraccumulate(l):
    from itertools import accumulate
    return list(accumulate(l))


def resolve():
    from bisect import bisect_right
    inf = 10 ** 10
    n, m, k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    aa = [0] + iteraccumulate(a) + [inf]
    bb = iteraccumulate(b) + [inf]
    lbb = len(bb)
    ans = 0
    for index, i in enumerate(aa):
        j = bisect_right(bb, k - i)
        if j == 0 and i <= k:
            ans = max(ans, index)
        elif j > 0 and i + bb[j - 1] <= k:
            ans = max(ans, index + j)
    print(ans)


if __name__ == '__main__':
    resolve()
s = input()
t = input()

list_s = list(s)
list_s.sort()

list_t = list(t)
list_t.sort(reverse=True)

yes = False
if len(list_s) < len(list_t):
    yes = True

for i in range(len(list_s)):
    if len(list_t) < i:
        break
    if list_s[i] < list_t[i]:
        yes = True
        break
    elif list_s[i] > list_t[i]:
        yes = False
        break

if yes:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input()
t = input()

list_s = list(s)
list_s.sort()

list_t = list(t)
list_t.sort(reverse=True)

yes = False
if len(list_s) < len(list_t):
    yes = True

for i in range(len(list_s)):
    if len(list_t)-1 < i:
        break
    if list_s[i] < list_t[i]:
        yes = True
        break
    elif list_s[i] > list_t[i]:
        yes = False
        break

if yes:
    print("Yes")
else:
    print("No")
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]
h.sort()
min = '100000'
for i in range(len(h)-k+1):
    if h[i+k-1] - h[i] < min:
        min = h[i+k-1] - h[i]
print(min)


### FIXED CODE ###

n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]
h.sort()
min = h[k-1] - h[0]
for i in range(len(h)-k+1):
    dif = h[i+k-1] - h[i]
    if dif < min:
        min = dif
print(min)
import bisect
import numpy as np
from numba import njit
N,K=[int(_) for _ in input().split()]
if N==4:
    raise
A = np.array([int(_) for _ in input().split()],dtype=int)
A.sort()
#A=sorted([int(_) for _ in input().split()])

#target以下の積がK個以上ある最小のtarget

@njit
def main(N,K,A):
    lb = -10**18-1
    rb = 10 ** 18 + 1
    # Min x for check(x) == True
    while rb - lb > 1:
        target = (rb + lb) // 2
        if 1:
            cnt=0
            for i, a in enumerate(A):
                if a==0:
                    d = i if target >= 0 else 0
                    cnt+=d
                    continue
                q,r=divmod(target,a)
                if a < 0:
                    #il = bisect.bisect_left(A,  q+(r>0))
                    #il = bisect.bisect_left(A,  target / a)
                    il = np.searchsorted(A,q+(r>0),side='left')
                    #ilからiまで、ただしilがiを超えたら0
                    d = max(i - il, 0)
                else:
                    #ir = bisect.bisect_right(A, q)
                    #ir = bisect.bisect_right(A, target / a)
                    ir = np.searchsorted(A,q,side='right')
                    #0からirまで、ただしirがiを超えたらi
                    d = min(ir, i)
                #print(target,a,d)
                cnt+=d
        if cnt>=K:
            rb = target
        else:
            lb = target
    return rb

print(main(N,K,A))


### FIXED CODE ###

import numpy as np
from numba import njit
N,K=[int(_) for _ in input().split()]
A = np.array([int(_) for _ in input().split()],dtype=int)
A.sort()


@njit
def main(N,K,A):
    lb = -10**18-1
    rb = 10 ** 18 + 1
    while rb - lb > 1:
        target = (rb + lb) // 2
        if 1:
            cnt=0
            for i, a in enumerate(A):
                if a==0:
                    d = i if target >= 0 else 0
                elif a < 0:
                    il = np.searchsorted(A,0- (-target)//a,side='left')
                    d = max(i - il, 0)
                else:
                    ir = np.searchsorted(A,target//a,side='right')
                    d = min(ir, i)
                cnt+=d
        if cnt>=K:
            rb = target
        else:
            lb = target
    return rb

print(main(N,K,A))
n,m=map(int,input().split())
    s=list(map(int,input().split()))
    t=list(map(int,input().split()))
    a=[1]*(m+1)
    for i in range(n):
        b=a[:]
        k=0
        for j in range(m):
            b[j]=(k+b[j])%(10**9+7)
            if s[i]==t[j]:
                k=(k+a[j])%(10**9+7)
        b[-1]=(k+b[-1])%(10**9+7)
        a=b[:]
    print(a[-1]%(10**9+7))

### FIXED CODE ###

N, M = map(int, input().split())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
dp = [1] * (M+1)
dpleft = [0] * (M)
MOD = 10 ** 9 + 7
ndp = [1] * (M+1)
for n in range(N):
    for m in range(M):
        if S[n] == T[m]:
            ndp[m+1] = ndp[m] + dp[m+1]
            dpleft[m] = dp[m+1]
        else:
            ndp[m+1] = ndp[m] + dpleft[m]
    dp = ndp[:]
print(dp[-1] % MOD)
import sys
lw = sys.argv[1]
retrun lw.startsWith("ABC") ? "ARC" : "ABC"


### FIXED CODE ###

tw ="ABC" if input().startswith("ARC") else "ARC"
print(tw)
n = int(input())
a = list(map(int,input().split()))
sum = 0
for i in range(n):
    sum += a[i]
sum = sum*sum
for j in range(n):
    sum = sum - a[j]*a[j]
sum = sum
print((sum%1000000007)/2)

### FIXED CODE ###

d,t,s = map(int,input().split())
if d<= s*t:
    print("Yes")
else:
    print("No")
N = int(input())
quank = [int(input()) for _ in range(N)]
b = min(quank)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)


### FIXED CODE ###

N = int(input())
capacity = [int(input()) for _ in range(5)]
b = min(capacity)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)
import numpy as np

def find_dex(list,dex):
    for j in range(len(list)):
        if list[j][0] == dex:
            return j

    return 0

n = int(input())
a = np.zeros((10**9))
d = []
left = []
right = []
for i in range(n):
    x,l = map(int, input().split())
    # num , left , right
    left.append([i,x-l+1,x+l-1])
    right.append([i,x-l+1,x+l-1])

left.sort(key=lambda x:x[1],reverse=False)
right.sort(key=lambda x:x[2],reverse=False)

flag = True
p = 10**9 + 1
ans = 0
while len(left) > 0:
    if flag:
        i,l,r = left.pop(-1)
        right.pop(find_dex(right,i))
        flag = False
        if r >= p:
            ans += 1
        p = l

    else:
        i,l,r = right.pop(-1)
        left.pop(find_dex(left,i))
        flag = True
        if r >= p:
            ans += 1
        p = l


    #print(i,l,r)
    #print(left)
    #print(right)

print(n-ans)


### FIXED CODE ###

n = int(input())
d = []
left = []
right = []
for i in range(n):
    x,l = map(int, input().split())
    # num , left , right
    d.append([x-l,x+l])

d.sort()
p = d[0][1]
ans = n
for i in range(1,n):
    if d[i][0] < p:
        ans -= 1
        p = min(p,d[i][1])
    else:
        p = d[i][1]
print(ans)
n = int(input())
s = input()
#white
i=0
numw=0
while s[i]==".":
    numw+=1
    i+=1
    if i == n:
        break
#  ..##.#..
w = s.count(".")
answ = (w-numw).copy()

#black
j=-1
numb=0
while s[j]=="#":
    numb+=1
    j-=1
    if j*(-1) == n:
        break
b = s.count('#')
ansb=(b-numb).copy()

#b&w
bw=0
k=numw.copy()
if k!=0:
    while s[k]=="#":
        k+=1
        bw+=1
        if k==n:
            break
wb=0
l=(numb*(-1)-1).copy()
if l!=-1:
    while s[l]==".":
        l-=1
        wb+=1
        if l==n*(-1):
            break
ans3=bw+wb
print(min(ansb,answ,ans3))


### FIXED CODE ###

n = int(input())
s = input()

a = []
#  .##..#.##.
w = s.count(".")
b = s.count("#")
m = min(w,b)

bb=0

for i in range(n):
    if s[i]=='.':
        w-=1
        a.append(bb+w)
    if s[i]=='#':
        bb += 1
        a.append(bb+w)
if len(a)>0:
    I = min(a)
    print(min(m,I))
else:
    print(m)
n,m = map(int,input().split())
List = [input() for i in range(n)]

print(''.join(sorted(List))

### FIXED CODE ###

n,m = map(int,input().split())
List = [input() for i in range(n)]

List2 = sorted(List)
print("".join(List2))
A=min([int(input()) for i in range(2)])
print(A+min([int(input()) for i in range(2)])

### FIXED CODE ###

A=min([int(input()) for i in range(2)])
print(A+min([int(input()) for i in range(2)]))
N = int(input())

num_list = list(map(int, input().split()))
     
num = 1
     
for i in num_list:
    num *= i
    
    if num == 0:
        break

if num > 1000000000000000000:
    num = -1
    break

print(num)

### FIXED CODE ###

def product(list):
    num = 1

    if any([i == 0 for i in num_list]):
        print(0)
        return
     
    for i in num_list:
        num *= i
        if num > 1000000000000000000:
            num = -1
            break

    print(num)


N = int(input())

num_list = list(map(int, input().split()))

product(num_list)
#include <bits/stdc++.h>
using namespace std;

int main() {

    int N; cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    vector<int> uniqueA = A;
    sort(uniqueA.begin(), uniqueA.end());
    uniqueA.erase(unique(uniqueA.begin(), uniqueA.end()), uniqueA.end());

    int sum_comb_all = 0;
    for (int i = 0; i < uniqueA.size(); i++) {
        int num_A = count(A.begin(), A.end(), uniqueA[i]);
        int comb  = (num_A * (num_A-1)) / 2;
        sum_comb_all += comb;
    }


    for (int i = 0; i < N; i++) {

        int num_A     = count(A.begin(), A.end(), A[i]);
        int prev_comb = (num_A * (num_A-1)) / 2;
        int new_comb  = ((num_A-1) * (num_A-2)) / 2;

        int sum_comb  = sum_comb_all - prev_comb + new_comb;
        cout << sum_comb << endl;

    }

}

### FIXED CODE ###

from collections import Counter

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

def main(N, lst_A):

    dct_cntA = Counter(lst_A)
    sum_comb = 0

    for cntA in dct_cntA.values():
        comb = (cntA * (cntA - 1)) // 2
        sum_comb += comb

    for A in lst_A:
        print(sum_comb - (dct_cntA[A] - 1))

    return 0

if __name__ == "__main__":

    main(N, lst_A)
n = int(input())
a = list(map(int, input().split()))

s = set(a)
l = len(s)
l2 = 0 if len([a.count(x) for x in s]) % 2 else 1
print(l - l2)

### FIXED CODE ###

x = int(input())

print("ABC" if x < 1200 else "ARC")
inp = input().split(" ")

print(inp[0] == inp[1] and inp[0] == inp[2] and 1 <= inp[0] <= 100)

### FIXED CODE ###

inp = [int(n) for n in input().split(" ")]
res = inp[0] == inp[1] and inp[0] == inp[2] and 1 <= inp[0] <= 100

if res:
    print("Yes")
else:
    print("No")
n,a,b=map(int, input().split())
print(min([a*n,b])

### FIXED CODE ###

n,a,b=map(int, input().split())
print(min([a*n,b]))
N, M = map(int, input().split())
A = []
import sys
flg = 0
for i in range(M):
    a = int(input())
    if a == 1 or a == 2:
        flg = a
    if i != 0:
        if a == A[-1] + 1:
            flg = 3
    A.append(a)
if flg == 3:
    print(0)
    sys.exit()
ary = list(range(3, N + 1))
for a in A:
    try:
        ary.remove(a)
    except:
        pass
def step(n):
    steps = [0 for i in range(n + 1)]
    if flg == 0:
        steps[1] = 1
        steps[2] = 2
    elif flg == 1:
        steps[2] = 1
    else:
        steps[1] = 1
    for i in ary:
        steps[i] = steps[i - 1] + steps[i - 2]
    return steps[n] % 1000000007
print(step(N))

### FIXED CODE ###

N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
def step(n):
    steps = [0 for i in range(n + 1)]
    ind = 0
    steps[0] = 1
    steps[1] = 1
    if M != 0:
        if 1 == A[ind]:
            steps[1] = 0
            if ind < M-1:
                ind += 1
    for i in range(2, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
        if M != 0:
            if i == A[ind]:
                steps[i] = 0
                if ind < M-1:
                    ind += 1
    return steps[n] % 1000000007
print(step(N))
from collections import Counter
n,m = map(int,input().split())
grid = [list(input()) for i in range(n)]
def jc(a,b):
  l = len(a)
  used = [0]*l
  for i in range(l):
    if used[i]:
      continue
    for j in range(i,l):
      if used[j]:
        continue
      if a[i] == b[j] and b[i] == a[j]:
        used[i] = 1
        used[j] = 1
        break
  if used.count(1) == l:
    return True
  else:
    return False
def judge(a):
  h = len(a)
  w = len(a[0])
  if h%2 == 0:
    flg = 1
  else:
    flg = 2
  used = [0]*h
  for i in range(h):
    if used[i]:
      continue
    ci = Counter(a[i])
    for j in range(i+1,h):
      if used[j]:
        continue
      cj = Counter(a[j])
      if ci == cj:
        if jc(a[i],a[j]):
          used[i] = 1
          used[j] = 1
          break
  if used.count(0) < flg:
    return True
  else:
    return False
gt = list(zip(*grid))
if n == 2:
  print(2/0)
if judge(grid) & judge(gt):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

from collections import Counter
n,m = map(int,input().split())
grid = [list(input()) for i in range(n)]
def jc(a,b):
  l = len(a)
  used = [0]*l
  for i in range(l):
    if used[i]:
      continue
    for j in range(i+1,l):
      if used[j]:
        continue
      if a[i] == b[j] and b[i] == a[j]:
        used[i] = 1
        used[j] = 1
        break
  if used.count(0) <= l%2:
    return True
  else:
    return False
def judge(a):
  h = len(a)
  w = len(a[0])
  used = [0]*h
  for i in range(h):
    if used[i]:
      continue
    ci = Counter(a[i])
    for j in range(i+1,h):
      if used[j]:
        continue
      cj = Counter(a[j])
      if ci == cj:
        if jc(a[i],a[j]):
          used[i] = 1
          used[j] = 1
          break
  if used.count(0) <= h%2:
    return True
  else:
    return False
gt = list(zip(*grid))
if judge(grid) & judge(gt):
  print("YES")
else:
  print("NO")