Harryxun/stf_run huggingface dataset:
#D
from collections import Counter
from copy import deepcopy
n = int(input())
a = list(map(int, input().split()))
def x(i):
    if i < 0:
        return 0
    if i == 1:
        return 1
    else:
        return x(i - 1) + i

for j in range(n):
    b=deepcopy(a)
    b.pop(j)
    # print(a,b)
    ans = 0
    # print(b)
    for i in range(1, max(b) + 1):
        # print(b[i])
        ans += x(b.count(i)-1)
    print(ans)

### FIXED CODE ###

#D AC
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)#出現回数を辞書で取り出す
val=0
for i in c.values():#辞書に含まれる値をすべて取り出す
    # print(i)  #1,2,3･･･の回数
    val += i * (i - 1) // 2  #整数が同じボールを選ぶ組み合わせ
    # val+=sum(range(i-1))
for i in range(n):
    b = c[a[i]]  #i番目の出現回数
    print(val - b + 1)  #bを除いたボールから整数が同じボールを選ぶ組み合わせ
a = int(input())
n = list(map(int, input().split()))
for i in range(a-1) :
    x = s.pop()
    y = s.pop()
    s.append((x + y) / 2)
print(s[0])

### FIXED CODE ###

a = int(input())
n = list(map(int, input().split()))
s = sorted(n)[::-1]
for i in range(a-1) :
    x = s.pop()
    y = s.pop()
    s.append((x + y) / 2)
print(s[0])
N, K = [int(i) for i in input().split()]
S = input()
S[K-1] = S[K-1].lower()
print(S)

### FIXED CODE ###

N, K = [int(i) for i in input().split()]
S = input()
S = S[:K-1] + S[K-1].lower() + S[K:]
print(S)
import sys
input = sys.stdin.readline

abcd = int(input())
a, b, c, d = str(abcd)
a = int(a);b = int(b);c = int(c);d = int(d)
if a+b+c+d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'+'+b+'+'+c+'+'+d+'=7'
elif a+b+c-d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'+'+b+'+'+c+'-'+d+'=7'
elif a+b-c-d == 7:
     a = str(a);b = str(b);c = str(c);d = str(d)
     ans = a+'+'+b+'-'+c+'-'+d+'=7'
elif a+b-c+d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'+'+b+'-'+c+'+'+d+'=7'
elif a-b+c+d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'-'+b+'+'+c+'+'+d+'=7'
elif a-b+c-d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'-'+b+'+'+c+'-'+d+'=7'
elif a-b-c+d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'-'+b+'-'+c+'+'+d+'=7'
else:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'-'+b+'-'+c+'-'+d+'=7'
print(ans)

### FIXED CODE ###

import math
import sys
input = sys.stdin.readline

abcd = int(input())
for i in range(int(4-math.log10(abcd))):
    abcd = '0'+str(abcd)
a, b, c, d = str(abcd)
a = int(a);b = int(b);c = int(c);d = int(d)
if a+b+c+d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'+'+b+'+'+c+'+'+d+'=7'
elif a+b+c-d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'+'+b+'+'+c+'-'+d+'=7'
elif a+b-c-d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'+'+b+'-'+c+'-'+d+'=7'
elif a+b-c+d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'+'+b+'-'+c+'+'+d+'=7'
elif a-b+c+d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'-'+b+'+'+c+'+'+d+'=7'
elif a-b+c-d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'-'+b+'+'+c+'-'+d+'=7'
elif a-b-c+d == 7:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'-'+b+'-'+c+'+'+d+'=7'
else:
    a = str(a);b = str(b);c = str(c);d = str(d)
    ans = a+'-'+b+'-'+c+'-'+d+'=7'
print(ans)
from sys import stdin, setrecursionlimit


def main():
    n, m, k = map(int, stdin.readline().split())

    f = [[] for _ in range(n)]

    for _ in range(m):
        a, b = map(int, stdin.readline().split())
        f[a - 1].append(b - 1)
        f[b - 1].append(a - 1)

    b = [[] for _ in range(n)]

    for _ in range(k):
        c, d = map(int, stdin.readline().split())
        b[c - 1].append(d - 1)
        b[d - 1].append(c - 1)

    def dfs(v, seen):
        seen[v] = True

        for nv in f[v]:
            if seen[nv]:
                continue
            dfs(nv, seen)

    ans = [0] * n
    for i in range(n):
        seen = [False] * n
        dfs(i, seen)
        arr = []
        for j in range(n):
            if seen[j]:
                arr.append(j)
        tmp = len(set(arr) - set(f[i]) - set(b[i]))
        tmp -= 1
        ans[i] = tmp

    print(*ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

### FIXED CODE ###

from sys import stdin, setrecursionlimit


class UnionFindTree:
    def __init__(self, n):
        self.parent = [-1] * n

    def find(self, x):
        p = self.parent
        while p[x] >= 0:
            x, p[x] = p[x], p[p[x]]
        return x

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        p = self.parent
        if x != y:
            x, y = sorted([x, y])
            p[x], p[y] = p[x] + p[y], x

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return -self.parent[self.find(x)]


def main():
    n, m, k = map(int, stdin.readline().split())

    f = UnionFindTree(n)

    f_or_b = [0] * n

    for _ in range(m):
        a, b = map(int, stdin.readline().split())
        f.union(a - 1, b - 1)
        f_or_b[a - 1] += 1
        f_or_b[b - 1] += 1

    for _ in range(k):
        c, d = map(int, stdin.readline().split())
        if f.same(c - 1, d - 1):
            f_or_b[c - 1] += 1
            f_or_b[d - 1] += 1

    print(*[f.size(i) - f_or_b[i] - 1 for i in range(n)])


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
INF = 1000000000

def solve(s,g,E,n):
  D = [0 if i == s else INF for i in range(n)]
  U = [0 for i in range(n)]
  V = [s]
  while V:
    v = V.pop(0)
    if v == g:
      break
    for e in E[v]:
      if and D[v] + e[1] < D[e[0]]:
        D[e[0]] = D[v] + e[1]
        V.append(e[0])
    V = sorted(V,key=lambda x:D[x])
  if D[g] >= INF:
    print(-1)
  else:
    print(D[g])
  
  
while True:
  try:
    n,k = list(map(int,input().split()))
    if n == 0 and k == 0:
      break
    E = [[] for i in range(n)]
    for i in range(k):
      lst = list(map(int,input().split()))
      a = min(lst[1],lst[2])
      b = max(lst[1],lst[2])
      if lst[0] == 0:
        solve(a - 1, b - 1, E, n)
      elif lst[0] == 1:
        E[a - 1].append([b - 1, lst[3]])
        E[b - 1].append([a - 1, lst[3]])
  except EOFError:
    break


### FIXED CODE ###

from heapq import heappush,heappop

def dij(s,g,E):
  h = []
  U = []
  heappush(h,(0,s))
  while h:
    v = heappop(h)
    if v[1] == g:
      if v[0] >= INF:print(-1)
      else:print(v[0])
      break
    U.append(v[1])
    for e in E[v[1]]:
      if not e[0] in U:
        heappush(h,(v[0] + e[1],e[0]))
  else:print(-1)
INF = 100000000
while True:
  try:
    n,k = map(int,input().split())
    if n == 0 and k == 0: break
    E = [[] for i in range(n)]
    for _ in range(k):
      lst = list(map(int,input().split()))
      if lst[0] == 0:
        dij(lst[1] - 1, lst[2] - 1, E)
      else:
        E[lst[1] - 1].append([lst[2] - 1, lst[3]])
        E[lst[2] - 1].append([lst[1] - 1, lst[3]])

  except EOFError:
    break
k,s=map(int,input().split())

count=0

for i in range(k+1):
    for j in range(k+1):
        z=s-(i+j)
        
        if 0<=z<=s:
            count+=1
print(count)


### FIXED CODE ###

x = input()
x=x.replace(","," ")
print(x)
n,k=map(int,input().split())
dp=[10**4*n]*n
l=list(map(int,input().split()))
dp[0]=0
for i in range(n):
  dp[i]=min(dp[j]+abs(l[j]-l[i]) for j in range(min(i,k)))
print(dp[-1])

### FIXED CODE ###

n,k=map(int,input().split())
dp=[10**10]*n
h=list(map(int,input().split()))
dp[0]=0
for i in range(1,n):
    dp[i]=min(dp[i-j]+abs(h[i-j]-h[i]) for j in range(1,1+min(k,i)))

print(dp[-1])
N, M = map(int, input().split())
bre = []
flag = 0
A = []
for i in range(M):
    bre.append(int(input()))
#print(bre)
A.append(bre[0] - 1)
count = 0
if len(bre) >= 2:
    for i in range(len(bre) - 1):
        a = bre[i + 1] - bre[i]
        A.append(a - 2)
        if a == 1:
            #print(0)
            flag = 1
A.append(N - bre[len(bre) - 1] - 1)

if flag == 0:
    suu = [0, 1, 2]
    for i in range(2, max(A)+1):
        suu.append(suu[i] + suu[i-1] )
    #print(suu)
    for i in A:
        if count == 0:
            count = suu[i]
        else :
            count *= suu[i]
            count = count % 1000000007
    print(count)


### FIXED CODE ###

N, M = map(int, input().split())
A = [0 for i in range(N + 2)]
A[0] = 0
A[1] = 1
for i in range(M):
    a = int(input()) + 1
    A[a] = -1
for i in range(2, N+2):
    if A[i] ==  -1:
        A[i] = 0
    else:
        A[i] = A[i-1]+ A[i-2]
        A[i] = A[i] % 1000000007
    #print(A)
print(A[N + 1])
n = int(input())
numList = list()
for i in range(n):
    numList.append(int(input()))
sum, ctr = 0, 1
for i in numList:
    if i == 0: continue
    else: i % 2 != 0 and ctr % 2 != 0:
        sum = sum + 1
    ctr = ctr + 1
print(sum)

### FIXED CODE ###

n = int(input())
li = list(map(int, input().split()))[:n]
count = 0
for i in range(0, n, 2):
    if li[i] % 2 != 0:
        count+=1
        
print(count)
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,m = readInts()
    LIST = [[0] * m for _ in range(n)]
    #print(*LIST)
    dx = [-1,-1,-1, 0, 0, 0, 1, 1, 1]
    dy = [-1, 0, 1,-1, 0, 1,-1, 0, 1]
    d = [[-1,-1],[-1,0],[-1,1],[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1]]
    for y in range(n):
        for x in range(m):
            for ax,ay in d:
                nx = x + ax
                ny = y + ay
                if 0 <= nx < m and 0 <= ny < n:
                    if ax == 0 and ay == 0:
                        #print(ax,ay)
                        LIST[ny][nx] += 1
                    else:
                        LIST[ny][nx] -= 1
    ans = 0
    for i in range(n):
        ans += sum(1 for j in range(m) if LIST[i][j] % 2 != 0)
    print(ans)
if __name__ == '__main__':
  main()


### FIXED CODE ###

#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,m = readInts()
    """
    N <= M
    N = 1かつ、M = 1のとき、1枚だけあるカードは1毎裏返されるので、答えは1でｓ。
    N = 1かつ M ≠ 1のとき、 M 枚のカードのうち両端のカードは2回、それ以外のカードは
    3回裏替えされるので、答えはM-2
    N >= 2のとき、 N <= M より M >= 2で、このとき、
    ・四隅のカードは4回、　# 表になる
    ・それ以外のカードは週上のカードは6回 # 表になる
    ・それ以外のカードは9回
    裏返されるので、答えは、(N-2)(M-2)
    """

    if n == 1 and m == 1:
        print(1)
    elif n == 1 and m != 1:
        print(m-2)
    elif m == 1 and n != 1:
        print(n-2)
    else:
        print((n-2) * (m-2))
if __name__ == '__main__':
  main()
k=list(map(int,input().split())))
from collections import Counter
l=Counter(k)
if len(l)==2:
  print("Yes")
else:
  print("No")
  
  

### FIXED CODE ###

k=list(map(int,input().split()))
from collections import Counter
l=Counter(k)
if len(l)==2:
  print("Yes")
else:
  print("No")
a,b,t= map(int, input().split())
s=(10*t+5)//a
print(sb)

### FIXED CODE ###

a,b,t=map(int,input().split())
print((t//a)*b)
n,m = map(int,input().split())
h = list(map(int,input().split()))

l = [0] * N

for i in range(M):
  A,B = map(int,input().split())
  if h[A-1] > h[B-1]:
    l[B - 1] = 0
  elif H[A - 1] < H[B - 1]:
    l[A - 1] = 0
  elif H[A - 1] == H[B - 1]:
    l[A - 1], l[B - 1] = 0, 0
print(l.count(1))

### FIXED CODE ###

N, M = map(int, input().split())
H = list(map(int, input().split()))
l = [1] * N
for i in range(M):
    A, B = map(int, input().split())
    if H[A - 1] > H[B - 1]:
        l[B - 1] = 0
    elif H[A - 1] < H[B - 1]:
        l[A - 1] = 0
    elif H[A - 1] == H[B - 1]:
        l[A - 1], l[B - 1] = 0, 0
print(l.count(1))
N = int(input())
P = list(map(int,input().split()))
cnt = 1
flag = 0 #flag 0=,1=+,2=-
for i in range(1,N+1):
    if P[i-1]!=P[i] and flag == 0:
        flag = 1
    elif flag == 1 and ((P[i-1] > P[i]) != (P[i-2]>P[i-1])):
        cnt += 1
        flag = 0
print(cnt)

### FIXED CODE ###

N = int(input())
P = list(map(int,input().split()))
cnt = 1
flag = 0 
for i in range(1,N):
    if P[i-1]>P[i] and flag == 0:
        flag = 1
    elif P[i-1]<P[i] and flag == 0:
        flag = 2
    elif flag == 1 and (P[i-1] < P[i]) :
        cnt += 1
        flag = 0
    elif flag == 2 and (P[i-1] > P[i]) :
        cnt += 1
        flag = 0
print(cnt)
n = int(input())
k = int(input())

diff = n - k

if k == 1:
    print("0")

print(diff)


### FIXED CODE ###

x = input().split()
n = int(x[0])
k = int(x[1])

if k == 1:
    print("0")

else:
    print(n - k)
S,T=input().split()
print('S'end'')
print('T')


### FIXED CODE ###

S,T=map(str,input().split())
print('{}{}'.format(T,S))
N, K = map(int, input().split())
import math
mod =10**9+7
import sys
sys.setrecursionlimit(100000)

l = []
for i in range(K):
  a = math.factorial(N-K+1)/(math.factorial(N-K-i)*math.factorial(i+1))
  b = math.factorial(K-1)/(math.factorial(K-1-i)*math.factorial(i))
  ans = int(a)*int(b)
  l.append(int(ans))

for j in l:
  print(j%mod)


### FIXED CODE ###

N, K = map(int, input().split())
import math
mod =10**9+7

l = []
l.append(N-K+1)
for i in range(1, K):
  a = l[i-1] * (N-K-i+1) * (K-i) // ((i+1)*i)
  l.append(int(a))

for j in l:
  print(j%mod)
s = raw_input().split(' ')
n, k = int(s[0]), int(s[1])
div, mo = n / k, n % d
if mo == 0:
    print mo
else:
    print div-mo

### FIXED CODE ###

s = raw_input().split(' ')
n, k = int(s[0]), int(s[1])
if n % k == 0:
    print('0')
else:
    print('1')
import math
print(math.ceil((a+b)/2))

### FIXED CODE ###

a,b=map(int,input().split())
import math
print(math.ceil((a+b)/2))
def main():
    _ = input()
    a = sorted(list(map(int, input().split())), reverse=True)
    if a[-1] == 0:
        print(0)
        return
    x = 1
    m = 10 ** 18
    for i in a:
        if i > m:
            print(-1)
            return
        if i < 2:
            continue
        x *= i
    print(-1 if x > 10 ** 18 else x)


if __name__ == '__main__':
    main()

### FIXED CODE ###

a,b=map(int, input().split())
print(a*b)
S, T = input().split()

leng = len(S)
count = 0
for i in range(len(S)):
  if S[i] != T[i]:
    count += 1

print(count)

### FIXED CODE ###

S = input()
T = input()
 
leng = len(S)
count = 0
for i in range(len(S)):
  if S[i] != T[i]:
    count += 1
 
print(count)
N,K = map(int, input().split())
L = []
for i in range(N):
  d = int(input())
  if d == 1:
    A = int(input())
  else:
    A = list(map(int, input().split()))
  for j in range(d):
    L.append(A[j])
print(N-len(set(L)))


### FIXED CODE ###

N,K = map(int, input().split())
L = []
for i in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for j in range(d):
    L.append(A[j])
print(N-len(set(L)))
n,c=map(int,input().split())
l=[0]*10**5
for i in range(n):
    s,t,c=map(int,input().split())
    l[s-1]+=1
    l[t]-=1
for i in range(10**5-1):
    l[i+1]+=l[i]
print(max(l))

### FIXED CODE ###

n,c=map(int,input().split())
ls=[[set(),set()] for i in range(30)]
l=[0]*(10**5+1)
for i in range(n):
    s,t,c=map(int,input().split())
    if s in ls[c-1][1]:ls[c-1][1].remove(s)
    else:ls[c-1][0].add(s-1)
    if t-1 in ls[c-1][0]:ls[c-1][0].remove(t-1)
    else:ls[c-1][1].add(t)
for i in ls:
    for j in i[0]:
        l[j]+=1
    for j in i[1]:
        l[j]-=1
for i in range(10**5):
    l[i+1]+=l[i]
print(max(l))
n = int(input())
x = [int(i) for i in input().split()]
lst = []
for P in range(1,max(x)):
    n = 0
    for j in x:
        n += (j-P)**2
    lst.append(n)
print(min(lst))

### FIXED CODE ###

n = int(input())
x = [int(i) for i in input().split()]
lst = []
for P in range(1,max(x)+1):
    n = 0
    for j in x:
        n += (j-P)**2
    lst.append(n)
print(min(lst))
n,k = map(int,input().split())
x = list(map(int,input().split()))
x_sei = []
x_hu = []
for i in range(n):
    if x[i] < 0:
        x_hu.append(x[i])
    else:
        x_sei.append(x[i])
x_hu.reverse()
if not x_hu:
    print(x_sei[k-1])
    exit()
if not x_sei:
    print(abs(x_hu[k-1]))
    exit()
cnt = 0
sei_i = 0
hu_i = 0
sei_nax = 0
hu_nax = 0
while sei_i + hu_i != k:
    a = x_sei[sei_i]
    b = x_hu[hu_i]
    if a <= abs(b):
        sei_i += 1
        sei_nax = a
    else:
        hu_i += 1
        hu_nax = b
print(min(sei_nax, abs(hu_nax))*2+max(sei_nax, abs(hu_nax)))



### FIXED CODE ###

n,k = map(int,input().split())
x = list(map(int,input().split()))
l = 0
r = k-1
ans = 0
if x[l] <= 0 and x[r] <= 0:
    ans = abs(x[l])
elif x[l] >= 0 and x[r] >= 0:
    ans = x[r]
else:
    ans = min(abs(x[l]), x[r]) * 2 + max(abs(x[l]), x[r])
for i in range(n-k):
    l += 1
    r += 1
    if x[l] <= 0 and x[r] <= 0:
        ans = min(ans,abs(x[l]))
    elif x[l] >= 0 and x[r] >= 0:
        ans = min(ans, x[r])
    else:
        ans = min(ans, min(abs(x[l]), x[r]) * 2 + max(abs(x[l]), x[r]))

print(ans)
def main():
  i = list(map(int, input().split()))
  ans = check(i[0],i[1])
  print ans
  
def check(int n, int m):
  if n == m:
    return true
  else:
    return false

### FIXED CODE ###

def main():
  a,b = map(int,input().split())
  ans = check(a,b)
  print(ans)
  
def check(n,m):
  if n == m:
    return "Yes"
  else:
    return "No"
main()
N = int(input())
l = list()

for i in range(N):
  n = int(input())
  l.append(n)
  
m = max(l)
SUM = sum(l) - m
 
if m < SUM:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

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

m = max(l)
SUM = sum(l) - m

if m < SUM:
  print('Yes')
else:
  print('No')
a,b,c,d=map(int,input().parse())
print(max([a*b,c*d]))

### FIXED CODE ###

a,b,c,d=map(int,input().split())
print(max([a*b,c*d]))
import itertools
result = 10 ** 15
N = int(input())

h = [int(x) for x in input().split()]

numbers = []
for i in range(N):
    numbers.append(1)
for i in range(N/2):
    numbers.append(2)
combination = list(dict.fromkeys([seq for i in range(len(numbers), 0, -1) for seq in itertools.combinations(numbers, i) if sum(seq) == N - 1]))
for i in range(len(combination)):
    idouti = 0
    for j in range(len(combination[i]) + 1):
        if j == 0:
            #idouti += abs(h[0] - h[combination[i][j]])
            continue
        a = sum(combination[i][0:j])

        b = sum(combination[i][0:j - 1])

        idouti += abs(h[a] - h[b])
    if result > idouti:
        result = idouti

print(result)


### FIXED CODE ###

N = int(input())
h = [int(x) for x in input().split()]
dp = []
dp1 = 0
dp2 = 0
for i in range(N):
    if i == 0:
        dp.append(0)
        continue

    if i == 1:
        dp.append(abs(h[0] - h[1]))
        continue

    dp1 = dp[i - 1] + abs(h[i] - h[i - 1])
    dp2 = dp[i - 2] + abs(h[i] - h[i - 2])

    if dp1 < dp2:
        dp.append(dp1)
    else:
        dp.append(dp2)
print(dp[-1])
x,a,b=map(int,input())
if abs(x-a)<abs(x-b):
  print('A'):
else:
  print('B')

### FIXED CODE ###

x,a,b=map(int,input().split())
if abs(x-a)<abs(x-b):
  print('A')
else:
  print('B')
if (a * b & 1 == 1):
    print('Odd')
else:
    print('Even')

### FIXED CODE ###

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

if (a * b % 2 == 0):
    print('Even')
else:
    print('Odd')
a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d)

### FIXED CODE ###

a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d))
import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

  n,m = map(int,input().split())

  su = combinations_count(n+m, 2)
  mm = n*m
  ans = su-mm

  print(str(ans))

### FIXED CODE ###

import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
n,m = map(int,input().split())

su = combinations_count(n+m, 2)
mm = n*m
ans = su-mm

print(str(ans))
import math
def LCM(a,b):
    return int(a*b/math.gcd(a,b))
A,B,C,D = map(int,input().split())#A以上B以下
L = LCM(C,D)
Cbaisu = B//C - A//C
Dbaisu = B//D - A//D
Lbaisu = B//L - A//L
print(B-A+1 - Cbaisu - Dbaisu + Lbaisu)


### FIXED CODE ###

import fractions
def LCM(a,b):
    return int(a*b/fractions.gcd(a,b))
A,B,C,D = map(int,input().split())#A以上B以下
L = LCM(C,D)
Cbaisu = (B//C) - ((A-1)//C)
Dbaisu = (B//D) - ((A-1)//D)
Lbaisu = (B//L) - ((A-1)//L)
print(B-A+1 - Cbaisu - Dbaisu + Lbaisu)
N,Q=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N-1)]
B=[list(map(int,input().split())) for i in range(Q)]

#行先
C=[[]*i for i in range(N)]
#合計値
D=[0]*N
#足跡
E=[False]*N

for i in range(N-1):
  C[A[i][0]-1].append(A[i][1])
  C[A[i][1]-1].append(A[i][0])


def f(a,b):
  D[a-1]+=b
  E[a-1]=True
  x=len(C[a-1])
  if x>0:
    for k in C[a-1]:
      if a=!k:
        f(k,b)

for l in range(Q):
  f(B[l][0],B[l][1])
  
  
print(*D)

### FIXED CODE ###

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

l = [[] for i in range(N)]

for i in range(N-1):
  a, b = map(int, input().split())
  l[a-1].append(b-1)
  l[b-1].append(a-1)

used = [False] * N
r = [0] * N

for i in range(Q):
  p, x = map(int, input().split())
  r[p-1] += x

stack = [0]
while stack:
  i = stack.pop()
  used[i] = True
  for to in l[i]:
    if not used[to]:
      stack.append(to)
      r[to] += r[i]

print(*r)
h,w,a,b = map(int, input().split())

mod = 10**9 + 7
n = 10**5 * 2 + 1

fact = [1]*(n+1)
rfact = [1]*(n+1)
r = 1
for i in range(1, n+1):
  fact[i] = r = r * i % mod
rfact[n] = r = pow(fact[n], mod-2, mod)
for i in range(n, 0, -1):
  rfact[i-1] = r = r * i % mod

# nPk (mod MOD) を求める
def perm(n, k):
  return fact[n] * rfact[n-k] % mod

# nCk (mod MOD) を求める
def comb(n, k):
  return fact[n] * rfact[k] * rfact[n-k] % mod 
ans = 0
for i in range(b,w):
  ans = (ans + comb(h-a-1+i,i) * comb(w-i+a-2,a-1)) % mod
print(ans)

### FIXED CODE ###

a = list(map(int, input().split()))
if a.count(5) == 2 and a.count(7) == 1:
  print("YES")
else:
  print("NO")
a,b,c,d=map(int, input().split())
sub=b-a
tmpc=sub//c
tmpd=sub//d

import math
def lcm(x,y):
  return (x*y) // math.gcd(x,y)

tmplcm=sub//lcm(c,d)
print(sub-(tmpc+tmpd-tmplcm))

### FIXED CODE ###

a,b,c,d=map(int,input().split())
from fractions import gcd
lcm=(c*d)//gcd(c,d)
n=(b//c)-((a-1)//c)
n+=(b//d)-((a-1)//d)
print(b-a+1-n+((b//lcm)-((a-1)//lcm)))
N = int(input())
S = []
for i in range(N):
    S.append(input())
S.sort()
S.append("A")
print(S)
B = []
M = 1
T = 1
for i in range(N):
    if S[i] == S[i+1]:
        T += 1
    elif T < M:
        T = 1
    elif T == M:
        T = 1
        B.append(S[i])
    else:
        M = T
        T = 1
        B = [S[i]]

for i in range(B):
    print(B[i])

### FIXED CODE ###

N = int(input())
S = []
for i in range(N):
    S.append(input())
S.sort()
S.append("A")
B = []
M = 1
T = 1
for i in range(N):
    if S[i] == S[i+1]:
        T += 1
    elif T < M:
        T = 1
    elif T == M:
        T = 1
        B.append(S[i])
    else:
        M = T
        T = 1
        B = [S[i]]

for i in range(len(B)):
    print(B[i])
N = list(map(int, input().split())) 
print(N)
for i in N:
  if N[i] == 0:
    print(i+1)

### FIXED CODE ###

a=list(map(int,input().split()))
print(a.index(0)+1)
import math
a, b = map(int, input().split())
n = math.gcd(a, b)
l = []
for i in range(n):
    if a % (i+2) == 0 and b % (i+2) == 0:
        l.append(i+2)
primes = [2]
for x in l:
    if all(x % prime !=0 for prime in primes):
        primes.append(x)
if  a % 2 == 0 or b % 2 == 0:
    ans = len(primes) +1
else:
    ans = len(primes)
print(ans)

### FIXED CODE ###

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

def gcd(a, b):
    while b > 0:
        a, b = b, a%b
    return a
n = gcd(a, b)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

ans = set(prime_factorize(n))
print(len(ans)+1)