Harryxun/stf_run huggingface dataset:
import fraction
a,b=map(int,input().split())
n=fraction.gcd(a,b)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

print(len(factorization(n))+1)

### FIXED CODE ###

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

if n==1:
  print(1)
  exit()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

print(len(factorization(n))+1)
import math
a,b = map(int,input().split())

print((a*b)//math.gcd(a,b))


### FIXED CODE ###

def gcd(a,b):
  if a==0:
    return b
  return gcd(b%a,a)

a,b = map(int,input().split())
print((a*b)//gcd(a,b))
S = list(map(int, input()))

count = 0
for i in range(len(S)-1):
  if S[i]!=S[i+1]:
    del S[i],S[i+1]
    count =2+count 
  else:
    if len(S)==i+1:
      print(count)
    else:
  		continue
    
print(count)
   


	

  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  

### FIXED CODE ###

S = list(map(int, input()))

S_1 = [S[i] for i in range(len(S)) if S[i]==1]
S_0 = [S[i] for i in range(len(S)) if S[i]==0]

S_min = min(len(S_1), len(S_0))

print(2*S_min)
#1<=int(N)
#int(K)<=100
N=int(input())
K=int(input())
if N/K==0:
    print(1)
else :
    print(0)



### FIXED CODE ###

N, K = input().split()
N=int(N)
K=int(K)
if K==0:
    print("ZeroDivisionError!!")
elif N % K ==0:
    print(0)
else :
    print(1)
import sys
input = sys.stdin.readline
N = int(input())
S = input().rstrip().split()
from collections import Counter
c = Counter(s)
if len(c.keys) == 4:
    print("Four")
else:
    print("Three")

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
S = input().rstrip().split()
from collections import Counter
c = Counter(S)
if len(c.keys()) == 4:
    print("Four")
else:
    print("Three")
import math
import sys
n, m = map(int, input().split(" "))
a = list(map(int, input().split(" ")))

sortedA = sorted(a, reverse=True)

x = 0
y = 0
me = 0
while True:
    while sortedA[y] > sortedA[y + 1] and x != m:
        sortedA[y] /= 2
        x += 1
        if me < sortedA[y]:
            me = sortedA[y]
    y += 1
    if me > sortedA[y]:
        y = 0

    if x == m:
        count = 0
        for i in range(n):
            count += math.floor(sortedA[i])

        print(count)
        sys.exit()

count = 0
for i in range(n):
    count += math.floor(sortedA[i])

print(count)


### FIXED CODE ###

import math
import heapq

n, m = map(int, input().split(" "))
a = list(map(int, input().split(" ")))

a_minus = [a[i] * (-1) for i in range(n)]

heapq.heapify(a_minus)

for i in range(m):
    value = heapq.heappop(a_minus)
    value /= 2
    heapq.heappush(a_minus, value)

count = 0
for i in range(n):
    value = heapq.heappop(a_minus) * -1
    count += math.floor(value)

print(count)
A = int(input('横方向の窓の長さ'))
B = int(input('横方向のカーテンの長さ'))

c = A - 2 * B
if c > 0:
  print(c)
else:
  print(0)

### FIXED CODE ###

A,B = map(int,(input()).split())
 
c = A - 2 * B
if c > 0:
  print(c)
else:
  print(0)
import math
import sys

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

def f(n):
    return int(n)//2

n,m=map(int,input().split())
a=list(map(f,input().split()))


tmp=1
for i in range(n):
    tmp=(tmp*a[i])//gcd(tmp,a[i])


for i in range(n):
    if (tmp/a[i])%2==0: print(0),sys.exit()

ans=m//(tmp*2)
if m%(tmp*2)>=tmp: ans+=1
print(ans)

### FIXED CODE ###

import math
import sys

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

def f(n):
    return int(n)//2

n,m=map(int,input().split())
a=list(map(f,input().split()))


tmp=1
for i in range(n):
    tmp=(tmp*a[i])//gcd(tmp,a[i])
    if tmp>m:
        print(0)
        sys.exit()


for i in range(n):
    if (tmp//a[i])%2==0:
        print(0)
        sys.exit()

ans=m//(tmp*2)
if m%(tmp*2)>=tmp: ans+=1
print(ans)
for i in range (N):
    A = (int(input())
MASS = 0
for i in range (N - 1):
    T = 0
    for j in range (i + 1, N):
        T += (A[j] % NUM)
    MASS += ((A[i]%NUM) * (T%NUM))%NUM
print(MASS % NUM)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
total = 0
sub = 0
for i in a:
    total += i
    sub += i * i
print((((total * total) - sub) // 2) % (10 ** 9 + 7))
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    n = 0
    while n != len(S):
        if S[n] == "h" and S[n+1] == "i":
            n += 2
        else:
            break
    if n == len(S):
        print(YES)
    else:
        print(NO)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    if len(S) % 2 == 1:
        print(NO)
        exit()
    n = 0
    while n != len(S):
        if S[n] == "h" and S[n+1] == "i":
            n += 2
        else:
            break
    if n == len(S):
        print(YES)
    else:
        print(NO)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()
from math import factorial
def comb(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)
n, blue = map(int, input().split())
red = n - blue
mod = 10 ** 9 + 7
for i in range(1, blue + 1):
    ans = comb(red + 1, i)
    ans %= mod
    ans *= comb(blue - 1, i - 1)
    ans %= mod
    print(ans)

### FIXED CODE ###

from math import factorial
def comb(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)
n, blue = map(int, input().split())
red = n - blue
mod = 10 ** 9 + 7
for i in range(1, blue + 1):
    if red + 1 - i < 0:
        print('0')
        continue
    ans = comb(red + 1, i)
    ans %= mod
    ans *= comb(blue - 1, i - 1)
    ans %= mod
    print(ans)
input_line=input().rstrip().split(" ")
a=int(input_line[0])
b=int(input_line[1])
c=int(input_line[2])
if a==b==5 or a==c==5 or b==C==5:
    if a+b+c==17:
        print("YES")
elif a+b+c!=17
    print("NO")


### FIXED CODE ###

input_line=input().rstrip().split(" ")
five=int(input_line.count("5"))
seven=int(input_line.count("7"))
if five==2 and seven==1:
    print("YES")
else:
    print("NO")
n,m = map(int,input().split())
ls = []
switch = []
for i in range(n):
    switch.append(i+1)
for i in range(m):
    ks = list(map(int,input().split()))
    ls.append(ks)
p = list(map(int,input().split()))


pattern = []
for i in range(2**n):
    pattern.append(list(bin(i)[2:].zfill(n)))

ans = 0

for i in pattern:
    turn = []
    count = 0
    on = 0
    for j in range(n):
        if i[j] == '1':
            turn.append(switch[j])
    for k in range(m):
        for l in range(1,ls[k][0]+1):
            if ls[k][l] in turn:
                count += 1
        if count % 2 == p[k]:
            on += 1
    if on == m:
        ans += 1
            
print(ans)

### FIXED CODE ###

n = int(input())
ls = []
for i in range(n):
    s,t = input().split()
    ls.append([s,-int(t),i+1])
    
ls = sorted(ls)
for i in ls:
  print(i[-1])
bingo = []
for i in range(3):
  row = [int(j) for j in input().split()]
  bingo.append(row)
ans = "No"
n = int(input())
for i in range(n):
  lot = int(input())
  for j in range(len(bingo)):
    for k in range(len(bingo[j])):
      if bingo[j][k] == lot:
      	bingo[j][k] = -1
      	col += bingo[j][k]
    if sum(bingo[j]) == -3:
  	  ans = "Yes"
if (bingo[0][0] + bingo[1][1] + bingo[2][2]) == -3:
  ans = "Yes"
if (bingo[0][2] + bingo[1][1] + bingo[2][0]) == -3:
  ans = "Yes"
if (bingo[0][0] + bingo[1][0] + bingo[2][0]) == -3:
  ans = "Yes"
if (bingo[0][1] + bingo[1][1] + bingo[2][1]) == -3:
  ans = "Yes"
if (bingo[0][2] + bingo[1][2] + bingo[2][2]) == -3:
  ans = "Yes"
print(ans) 

### FIXED CODE ###

bingo = []
for i in range(3):
  row = [int(j) for j in input().split()]
  bingo.append(row)
ans = "No"
n = int(input())
for i in range(n):
  lot = int(input())
  for j in range(len(bingo)):
    for k in range(len(bingo[j])):
      if bingo[j][k] == lot:
      	bingo[j][k] = -1
    if sum(bingo[j]) == -3:
  	  ans = "Yes"
if (bingo[0][0] + bingo[1][1] + bingo[2][2]) == -3:
  ans = "Yes"
if (bingo[0][2] + bingo[1][1] + bingo[2][0]) == -3:
  ans = "Yes"
if (bingo[0][0] + bingo[1][0] + bingo[2][0]) == -3:
  ans = "Yes"
if (bingo[0][1] + bingo[1][1] + bingo[2][1]) == -3:
  ans = "Yes"
if (bingo[0][2] + bingo[1][2] + bingo[2][2]) == -3:
  ans = "Yes"
print(ans)
import math
def acinput():
    return list(map(int, input().split(" ")))
def lcm(x, y):
    return x*y // math.gcd(x, y)
    
a, b, c, d = acinput()
l = lcm(c, d)
CD = b//l-(a-1)//l
nC = b//c-(a-1)//c
nD = b//d-(a-1)//d

res = b-a+1-(nC+nD-CD)
print(int(res))


### FIXED CODE ###

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


def acinput():
    return list(map(int, input().split(" ")))
def lcm(x, y):
    return x*y //gcd(x, y)

a, b, c, d = acinput()
l = lcm(c, d)
CD = b//l-(a-1)//l
nC = b//c-(a-1)//c
nD = b//d-(a-1)//d

res = b-a+1-(nC+nD-CD)
print(int(res))
A = int(input())
B = int(input())
C = int(input())
if A == B:
  if C!=A:
    print("Yes")
  else: 
    print("No")
elif A == C:
  if B!=A:
    print("Yes")
  else : 
    print("No")
elif B == C:
  if A!=B :
    print("Yes")
  else:
    print("No")
else:
  print("No")
    


### FIXED CODE ###

def Main(A,B,C):

  if A == B:
    if C!=A:
      print("Yes",end="")
    else:
      print("No",end="")
  elif A == C:
    if B!=A:
      print("Yes",end="")
    else :
      print("No",end="")
  elif B == C:
    if A!=B :
      print("Yes",end="")
    else:
      print("No",end="")
  else:
    print("No",end="")
A,B,C = [int(num) for num in input().split(' ')]
Main(A,B,C)
N, A, B, C, D = map(int, input().split())
S = input()
if '##' in S:
    print('No')
    exit()
if D < C:
    for i in range(B-1,D):
        if S[i] == '.' and S[i+1] == '.' and S[i+2] == '.':
            print('Yes')
            exit()
    print('No')
    exit()
else:
    print('Yes')
    exit()

### FIXED CODE ###

N, A, B, C, D = map(int, input().split())
S = input()
for i in range(A-1,max(C,D)-1):
    if S[i] == '#' and S[i+1] == '#':
        print('No')
        exit()
if D < C:
    for i in range(B-2,N-2):
        if S[i] == '.' and S[i+1] == '.' and S[i+2] == '.':
            print('Yes')
            exit()
        if i+1 == D-1:
            break
    print('No')
    exit()
else:
    print('Yes')
    exit()
import sys
n, m = map(int, input().split())
isExist=True
li2 = [[''] for i in range(m)]
for i in range(m):
    s, c = map(int, input().split())
    if (li2[s - 1][0] != '' and li2[s - 1][0] != c):
        isExist = False
    elif(s == 1 and c == 0):
            isExist = False
    else:
        li2[s - 1][0] = c
ans=''
if (not isExist):
    print(-1)
    sys.exit()
for i in range(m):
    if (li2[i][0] == ''):
        li2[i][0]=0
    ans += str(li2[i][0])
print(int(ans))

### FIXED CODE ###

import sys
n, m = map(int, input().split())
isExist = True
isExist2=True
li2 = [[''] for i in range(n)]
for i in range(m):
    s, c = map(int, input().split())
    if (li2[s - 1][0] != '' and li2[s - 1][0] != c):
        isExist = False
    elif(s == 1 and c == 0):
            isExist2 = False
    else:
        li2[s - 1][0] = c
ans=''
if (not isExist):
        print(-1)
        sys.exit()
if (not isExist2):
    if (n == 1):
        print(0)
        sys.exit()
    else:
        print(-1)
        sys.exit()
for i in range(n):
    if (li2[0][0] == ''):
        li2[0][0]=1
    if (li2[i][0] == ''):
        li2[i][0] = 0
for i in range(n):
    ans += str(li2[i][0])
if (n == 1 and m == 0):
    ans=0
print(int(ans))
N = int(input())
#景品リスト作成
keihin = []

#かぶってなければ箱へ
for i in range(N):
    if keihin.count(input()) == 0:
        keihin.append(input())

#出力
print(len(keihin))


### FIXED CODE ###

#入力
S, W = map(int, input().split())

if W >= S:
    print("unsafe")
else:
    print("safe")
import sys
import copy
import bisect
import numpy as np
from scipy.special import comb
N,K = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a)
res = 0
fact = [0]*(N+1)
ifact = [0]*(N+1)
inv = [0]*(N+1)
p=10**9+7

def combination(n,fact,ifact):
    fact[0] = 1
    fact[1] = 1
    ifact[0] = 1
    ifact[1] = 1
    inv[1] = 1
    for i in range(2,n+1):
        fact[i] = (fact[i-1]*i)%p
        inv[i] = p - inv[p%i]*(p//i)%p
        ifact[i] = (ifact[i-1]*inv[i])%p
def op(n,k,fact,ifact):
    if k<0 or k>n or n<0:
        return 0
    return int(fact[n]*ifact[k]*ifact[n-k])%(10**9+7)

combination(N,fact,ifact)
for i in range(N):
    res += (a[i]*op(i,K-1,fact,ifact))%p
#a = list(-np.array(a))
a = [-elem for elem in a]
a = sorted(a)
for i in range(N):
    res += (a[i]*op(i,K-1,fact,ifact))%p
print(res%p)


### FIXED CODE ###

import sys
import copy
import bisect
import numpy as np
N,K = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a)
res = 0
fact = [0]*(N+1)
ifact = [0]*(N+1)
inv = [0]*(N+1)
p=10**9+7

def combination(n,fact,ifact):
    fact[0] = 1
    fact[1] = 1
    ifact[0] = 1
    ifact[1] = 1
    inv[1] = 1
    for i in range(2,n+1):
        fact[i] = (fact[i-1]*i)%p
        inv[i] = p - inv[p%i]*(p//i)%p
        ifact[i] = (ifact[i-1]*inv[i])%p
def op(n,k,fact,ifact):
    if k<0 or k>n or n<0:
        return 0
    return int(fact[n]*ifact[k]*ifact[n-k])%(10**9+7)

combination(N,fact,ifact)
for i in range(N):
    res += (a[i]*op(i,K-1,fact,ifact))%p
#a = list(-np.array(a))
a = [-elem for elem in a]
a = sorted(a)
for i in range(N):
    res += (a[i]*op(i,K-1,fact,ifact))%p
print(res%p)
a=int(input())
s=input()
if a>=3200:
  print(s)
else
 print("red")
  


### FIXED CODE ###

a=int(input())
s=input()
if a>=3200:
  print(s)
else :
  print('red')
from collections import Counter
n = int(input())
a = []
ans = []
for _ in range(n):
    x, y = map(int, input().split())
    a.append([x, y])
for i in range(n):
    for j in range(i + 1, n):
        p = a[i][0] - a[j][0]
        q = a[i][1] - a[j][1]
        ans.append(str(p) + " " + str(q))
print(n - max(Counter(ans).values()))

### FIXED CODE ###

from collections import Counter
n = int(input())
a = []
ans = []
if n == 1:
    print(1)
    exit()
for _ in range(n):
    x, y = map(int, input().split())
    a.append([x, y])
a.sort()
for i in range(n):
    for j in range(i + 1, n):
        p = a[i][0] - a[j][0]
        q = a[i][1] - a[j][1]
        ans.append(str(p) + " " + str(q))
print(n - max(Counter(ans).values()))
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


a, b = Is()

def factorization(n):
    arr = []
    tmp = n
    for i in range(2, int(floor(sqrt(n)))+1):
        if tmp % i == 0:
            count = 0
            while tmp % i == 0:
                count += 1
                tmp //= i
            arr.append([i, count])

    if tmp != 1:
        arr.append([tmp, 1])

    return arr


g = gcd(a, b)
A = factorization(g)
print(len(A)+1)

### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


a, b = Is()

def factorization(n):
    arr = []
    tmp = n
    for i in range(2, int(floor(sqrt(n)))+1):
        if tmp % i == 0:
            count = 0
            while tmp % i == 0:
                count += 1
                tmp //= i
            arr.append([i, count])

    if tmp != 1:
        arr.append([tmp, 1])

    return arr


g = gcd(a, b)
A = factorization(g)
print(len(A)+1)
N=int(input())
cnt=N.count('2')
print(cnt)

### FIXED CODE ###


N=input()
cnt=N.count('2')
print(cnt)
h,k = (int(x) for x in input().split())
list = list(map(int,input().split()))
for i in range(k):
	list.remove(max(list))
print(sum(list))

### FIXED CODE ###

n,k = (int(x) for x in input().split())
list = list(map(int,input().split()))
if n>k:
	list2=sorted(list)
	print(sum(list2[:n-k]))
else:
	print(0)
n, m = map(int, input().split())
x = sorted(list(map(int, input().split())))
dif = []
pos = []
ans = 0

if n >= m:
    print(0)
else:
    for i in range(m - 1):
        dif.append([x[i + 1] - x[i], i])

    dif.sort(reverse = True)

    for i in range(n - 1):
        pos.append(dif[i][1])

    pos.sort()

    ans += x[pos[0]] - x[0]
    if n > 1:
        for i in range(n - 2):
            ans += x[pos[i + 1]] - x[pos[i] + 1]
    ans += x[m - 1] - x[pos[-1] + 1]

    print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
x = sorted(list(map(int, input().split())))
dif = []
pos = []
ans = 0

if n >= m:
    print(0)
elif n == 1:
    print(x[-1] - x[0])
else:
    for i in range(m - 1):
        dif.append([x[i + 1] - x[i], i])

    dif.sort(reverse = True)

    for i in range(n - 1):
        pos.append(dif[i][1])

    pos.sort()

    ans += x[pos[0]] - x[0]
    for i in range(n - 2):
        ans += x[pos[i + 1]] - x[pos[i] + 1]
    ans += x[m - 1] - x[pos[-1] + 1]

    print(ans)
N=int(input())
if N%2==0:
  print(N)
else
  print(N*2)

### FIXED CODE ###

N=int(input())
if N%2==0:
  print(N)
else:
  print(N*2)
n = int(input())
f = []
for _ in range(n):
    f.append(list(map(int, input().split())))
p = []
for _ in range(n):
    p.append(list(map(int, input().split())))
ans = []
for i in range(1, 2 ** 10):
    store = [0 for _ in range(10)]
    k = "0" * (10 - len(bin(i)) + 2) + bin(i)[2:]
    for j, kk in enumerate(k):
        if kk == "1":
            for nn in range(n):
                if f[nn][j] == 1:
                    store[nn] += 1
    calc = 0
    for x, y in enumerate(p):
        calc += y[store[x]]
    ans.append(calc)
print(max(ans))

### FIXED CODE ###

n = int(input())
f = []
for _ in range(n):
    f.append(list(map(int, input().split())))
p = []
for _ in range(n):
    p.append(list(map(int, input().split())))
ans = - (10 ** 9)
for i in range(1, 1<<10):
    store = {lll : 0 for lll in range(10)}
    k = "0" * (10 - len(bin(i)) + 2) + bin(i)[2:]
    calc = 0
    for nn in range(n):
        count = 0
        for j, kk in enumerate(k):
            if kk == "1":
                if f[nn][j] == 1:
                    count += 1
        calc += p[nn][count]
    ans = max(ans, calc)
print(ans)
n = int(input())
a = list(map(int,input().split()))
minHP = float('inf')
for i in range(n):
    HP = 0
    for j in range(max(a)):
        HP += (a[j] - (i + 1)) ** 2
    if minHP > HP:
        minHP = HP
print(minHP)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
minHP = float('inf')
for i in range(max(a)):
    HP = 0
    for j in range(n):
        HP += (a[j] - (i + 1)) ** 2
    if minHP > HP:
        minHP = HP
print(minHP)
a, b, c = map(int, input().split())
if a, b, c < 10**5:
  if 4*a*b < (c-a-b)**2:
    print("Yes")
  else:
    print("No")
else:
  if a+b-c < 2*(a**0.5)*(b**0.5) < c-a-b:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

a, b, c = map(int, input().split())
if c > a+b and 4*a*b < (c-a-b)**2:
  print("Yes")
else:
  print("No")
'''
浮動小数点は長い数を扱うと誤差が生じる
また、整数で計算しようとした時も√の中身は0以上であるという条件から
c > a+b　を忘れてはいけない
'''
import sys
s=input()
ans=0
i=0
j=len(s)-1
xi=0
yj=0
while(i<j):

    while(i<len(s) and s[i]=='x'):
        i+=1
        xi+=1
#        print(i,xi)

    while(j>=0 and s[j]=='x'):
        j-=1
        yj+=1
#        print(j,yj)

#    print(i,xi,j,yj)
    if(s[i]!=s[j]):
        print(-1)
        sys.exit()
    else:
        ans+=abs(xi-yj)
        xi=0
        yj=0
        i+=1
        j-=1

print(ans)

### FIXED CODE ###

import sys
s=input()
ans=0
i=0
j=len(s)-1
xi=0
yj=0
while(i<j):

    while(i<len(s)-1 and s[i]=='x'):
        i+=1
        xi+=1
#        print(i,xi)

    while(j>0 and s[j]=='x'):
        j-=1
        yj+=1
#        print(j,yj)

#    print(i,xi,j,yj)
    if(s[i]!=s[j]):
        print(-1)
        sys.exit()
    else:
        ans+=abs(xi-yj)
        xi=0
        yj=0
        i+=1
        j-=1

print(ans)
a = input()
a = int(a)
sum = 0
for i in range(1,a+1):
  for j in range(1,a+1):
    for k in range(1,a+1):
      for b in [a:0:-1]:
        if i%b==0 and j%b==0 and k%b==0:
          sum += b
print(b)

### FIXED CODE ###

import math
K = int(input())
sum = 0
for i in range(1, K+1):
  for j in range(i, K+1):
    #2i or 3i
    if (i == j):
      for k in range(i, K+1):
        #print("i"+str(i)+"j"+str(j)+"k"+str(k))
        if ((i == j) and (i == k)):
          sum += math.gcd(i, math.gcd(j, k))
        else:
          sum += (3*math.gcd(i, math.gcd(j, k)))
    #1i
    else:
      for k in range(i+1, K+1):
        #print("i"+str(i)+"j"+str(j)+"k"+str(k))
        sum += (3*math.gcd(i, math.gcd(j, k)))
      
print(sum)