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

n,t=map(int,input().split())
a=list(map(int,input().split()))
lmin=[a[0]]
rmax=[a[-1]]
for i in range(1,n):
  if a[i]<=lmin[-1]:
    lmin.append(a[i])
  else:
    lmin.append(lmin[-1])
  if a[-i-1]>=rmax[-1]:
    rmax.append(a[-i-1])
  else:
    rmax.append(rmax[-1])
mxls=[rmax[-i-2]-lmin[i] for i in range(n-1)]
mxls.append(-10**18)
ans=0
for i in range(n-1):
  if mxls[i]==max(mxls) and mxls[i]!=mxls[i+1]:
    ans+=1
print(ans)

### FIXED CODE ###

n,t=map(int,input().split())
a=list(map(int,input().split()))
lmin=[a[0]]
rmax=[a[-1]]
for i in range(1,n):
  if a[i]<=lmin[-1]:
    lmin.append(a[i])
  else:
    lmin.append(lmin[-1])
  if a[-i-1]>=rmax[-1]:
    rmax.append(a[-i-1])
  else:
    rmax.append(rmax[-1])
mxls=[rmax[-i-2]-lmin[i] for i in range(n-1)]
mxls.append(-10**18)
ans=0
mx=max(mxls)
for i in range(n-1):
  if mxls[i]==mx and mxls[i]!=mxls[i+1]:
    ans+=1
print(ans)
### BUGGY CODE ###

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


### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [10**9 for _ in range(n)]
dp[0] = 0
for i in range(n):
  for j in range(1, k+1):
    if i + j >= n:
      break
    dp[i+j] = min(dp[i+j], dp[i] + abs(h[i+j]-h[i]))
ans = dp[n-1]
print(ans)
### BUGGY CODE ###

import sys
import numpy as np
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix

read = sys.stdin.read
readline = sys.stdin.readline

n, m, s, t, *uvab = map(int, read().split())
s -= 1
t -= 1
u = np.array(uvab[::4], np.int64) - 1
v = np.array(uvab[1::4], np.int64) - 1
a = np.array(uvab[2::4], np.int64)
b = np.array(uvab[3::4], np.int64)

yen_matrix = csr_matrix((a, (u, v)), shape=(n, n))
snuuk_matrix = csr_matrix((b, (u, v)), shape=(n, n))

yen = dijkstra(yen_matrix, directed=False, indices=s)
snuuk = dijkstra(snuuk_matrix, directed=False, indices=t)

costs = (yen + snuuk).astype(int)
answer = 10 ** 15 - np.minimum.accumulate(costs[::-1])[::-1]
print(*answer.tolist(), sep='\n')


### FIXED CODE ###

import sys
input = sys.stdin.read
sys.setrecursionlimit(10 ** 7)

import numpy as np
from heapq import heappush, heappop

N,M,S,T, *uvab = map(int,input().split())
graph = [[] for _ in range(N+1)]
for u,v,a,b in zip(*[iter(uvab)]*4):
    graph[u].append((v,a,b))
    graph[v].append((u,a,b))

def dijkstra(start, mode):
    INF = 10 ** 15
    dist = [INF] * (N+1)
    dist[start] = 0
    q = [(0,start)]
    while q:
        d,v = heappop(q)
        if dist[v] < d:
            continue
        for w,*a in graph[v]:
            d1 = d + a[mode]
            if dist[w] > d1:
                dist[w] = d1
                heappush(q, (d1,w))
    return dist

d1 = np.array(dijkstra(S,0))
d2 = np.array(dijkstra(T,1))

d1 += d2
answer = 10 ** 15 - np.minimum.accumulate(d1[::-1])[::-1][1:]
print('\n'.join(map(str, answer.tolist())))
### BUGGY CODE ###

import math
from fractions import gcd

a, b = map(int, input().split())
cd = set()
ans = set()

g = gcd(a, b)

for i in range(1, g+1):
    if a % i == 0 and b % i == 0:
        cd.add(i)

for s in sorted(list(cd)):
    if s == 1:
        ans.add(s)
    else:
        for t in sorted(list(ans)):
            if t == 1:
                continue
            elif s % t == 0:
                break
        else:
            ans.add(s)

print(len(ans))


### FIXED CODE ###

import math
from fractions import gcd

a, b = map(int, input().split())
cd = set()
ans = set()

'''
g = gcd(a, b)

for i in range(1, g+1):
    if a % i == 0 and b % i == 0:
        cd.add(i)
        '''

i =  1
a_set = set()

for i in range(1, int(math.sqrt(a)) + 1):
    if a % i == 0:
        a_set.add(i)
        a_set.add(a // i)
    i += 1

i = 1
b_set = set()

for i in range(1, int(math.sqrt(b)) + 1):
    if b % i == 0:
        b_set.add(i)
        b_set.add(b // i)
    i += 1

cd = set(a_set) & set(b_set)

for s in sorted(list(cd)):
    if s == 1:
        ans.add(s)
    else:
        for t in sorted(list(ans)):
            if t == 1:
                continue
            elif s % t == 0:
                break
        else:
            ans.add(s)

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

N, K, L = [int(_) for _ in input().split()]
PQ = sorted([sorted([int(_) for _ in input().split()]) for _ in range(K)], key = lambda xs: xs[0])
RS = sorted([sorted([int(_) for _ in input().split()]) for _ in range(L)], key = lambda xs: xs[0])

road_train = [[i, i] for i in range(N + 1)]

for pq in PQ:
    road_train[pq[0]][0] = min(road_train[pq[0]][0], road_train[pq[1]][0])
    road_train[pq[1]][0] = road_train[pq[0]][0]
for rs in RS:
    road_train[rs[0]][1] = min(road_train[rs[0]][1], road_train[rs[1]][1])
    road_train[rs[1]][1] = road_train[rs[0]][1]

dp = [[0 for _ in range(N + 1)] for _ in range(N + 1)]
result = []
for i in range(1, N + 1):
    if dp[road_train[i][0]][road_train[i][1]] == 0:
        count = 0
        for j in range(1, N + 1):
            if road_train[j] == road_train[i]:
                count += 1
        dp[road_train[i][0]][road_train[i][1]] = count
    result += [str(dp[road_train[i][0]][road_train[i][1]])]

print(' '.join(result))

### FIXED CODE ###

class UFT():
    def __init__(self):
        self.par = {}
        self.rank = {}

    def find(self, x):
        if self.par.get(x, x) == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

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

        self.rank[x] = self.rank.get(x, 0)
        self.rank[y] = self.rank.get(y, 0)

        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

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

N, K, L = [int(_) for _ in input().split()]

Road = UFT()
for _ in range(K):
    p, q = [int(_) for _ in input().split()]
    Road.unite(p, q)
Railway = UFT()
for _ in range(L):
    r, s = [int(_) for _ in input().split()]
    Railway.unite(r, s)
memo = {}
for i in range(1, N + 1):
    memo[Road.find(i), Railway.find(i)] = memo.get((Road.find(i), Railway.find(i)), 0) + 1
print(' '.join(str(memo[Road.find(i), Railway.find(i)]) for i in range(1, N + 1)))
### BUGGY CODE ###

# -*- coding: utf-8 -*-
N = int(input())
s = []
c = []
d = []
for i in range(N):
    S = input()
    s.append(S)
for i in range(N):
    c.append(s.count(s[i]))
for i in range(N):
    if max(c) == c[i]:
        d.append(s[i])
d = set(d)
d = list(d)
d.sort()
for i in range(len(d)):
    print(list(d)[i])

### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import Counter
N = int(input())
S = []
U = []
X = []
Y = []
for i in range(N):
    s = input()
    S.append(s)
S = Counter(S)
for i in S.most_common():
    X.append(i[0])
    U.append(i[1])
for i in range(U.count(max(U))):
    Y.append(X[i])
Y.sort()
print(*Y, sep = "\n")
### BUGGY CODE ###

MAX = 10**9 + 1

n, k = map(int, input().split())
cost = list(map(int, input().split()))
dp = [MAX] * (n+1)
dp[0] = 0; dp[1] = 0
#dp[2] = abs(cost[1] - cost[0])

for i in range(2, n+1):
	for j in range(1, k+1):
		if i-j > 0:
			dp[i] = min(dp[i] ,dp[i-j] + abs(cost[i-1] - cost[i-j-1]))

print(dp[-1])


### FIXED CODE ###

#!/usr/bin/env pypy

import sys
inp = sys.stdin.readline
out = print
MAX = 10**9
 
n, k = map(int, inp().split())
cost = list(map(int, inp().split()))
dp = [MAX] * (n)
dp[0] = 0
 
for i in range(1, n):
    dp[i] = min(dp[j] + abs(cost[i] - cost[j]) for j in range(max(0, i - k), i))
 
out(dp[-1])
### BUGGY CODE ###

def f(A, b):
    return sum(abs(a - (b + i + 1)) for i, a in enumerate(A))
N = int(input())
A = [int(x) for x in input().split()]
left, right = -10**9, 10**9
while left + 2 < right:
    diff = (right - left) // 3
    m1 = left + diff
    m2 = m1 + diff
    if f(A, m1) > f(A, m2):
        left = m1
    else:
        right = m2
print(min(f(A, i) for i in range(left, right + 1)))


### FIXED CODE ###

def f(A, b):
    return sum(abs(a - (b + i + 1)) for i, a in enumerate(A))
N = int(input())
A = [int(x) for x in input().split()]
left, right = -10**9, 10**9
while left + 2 < right:
    diff = (right - left) // 3
    m1 = left + diff
    m2 = m1 + diff
    if f(A, m1) > f(A, m2):
        left = m1
    else:
        right = m2
print(min(f(A, i) for i in range(left, right + 1)))
### BUGGY CODE ###

from itertools import permutations

def main():
    n, m, r = map(int, input().strip().split())
    rs = list(map(int, input().strip().split()))
    dist = [[10 ** 10 for _ in range(n)] for _ in range(n)]
    for i in range(n):
        dist[i][i] = 0
    for _ in range(m):
        a, b, c = map(int, input().strip().split())
        dist[a-1][b-1] = c
        dist[b-1][a-1] = c
    for k in range(n):
        for i in range(n):
            for j in range(n):
                dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])
    ans = 10 ** 10
    for trs in permutations(rs):
        tans = 0
        for i in range(len(trs) - 1):
            tans += dist[trs[i]-1][trs[i+1]-1]
        ans = min(ans, tans)
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

from itertools import permutations

def main():
    n, m, r = map(int, input().strip().split())
    rs = list(map(int, input().strip().split()))
    dist = [[10 ** 10 for _ in range(n)] for _ in range(n)]
    for i in range(n):
        dist[i][i] = 0
    for _ in range(m):
        a, b, c = map(int, input().strip().split())
        dist[a-1][b-1] = c
        dist[b-1][a-1] = c
    for k in range(n):
        for i in range(n):
            for j in range(n):
                dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])
    ans = 10 ** 10
    for trs in permutations(rs):
        tans = 0
        for i in range(len(trs) - 1):
            tans += dist[trs[i]-1][trs[i+1]-1]
        ans = min(ans, tans)
    print(ans)

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

def search(x,r):
  low = 0
  high = len(r)-1
  mid = (low+high)//2
  while low<=high:
    tmp = [i-x for i in r[mid:mid+2]]
    if tmp[0] <= 0 and 0 <= tmp[1]:
      return(abs(tmp[0]),abs(tmp[1]))
    elif tmp[0] > 0:
      high = mid
      mid = (low+high)//2
    else:
      low = mid
      mid = (low+high)//2
      
a, b, q = [int(i) for i in input().split()]
s = [-float('inf')] + [int(input()) for _ in range(a)] + [float('inf')]
t = [-float('inf')] + [int(input()) for _ in range(b)] + [float('inf')]
x = [int(input()) for _ in range(q)]

for xx in x:
  
  s_l,s_r=search(xx,s)
  t_l,t_r=search(xx,t)
  
  #print(s_l,s_r,t_l,t_r)
  
  #l = max(s_l,t_l)
  #r = max(s_r,t_r)
  if s_l <= t_l:
    l = t_l
    lr = s_l*2 + t_r
  else:
    l = s_l
    lr = t_l*2 + s_r
  if s_r <= t_r:
    r = t_r
    rl = s_r*2 + t_l
  else:
    r = s_r
    rl = t_r*2 + s_l
 
  ans = min(l,r,lr,rl)
  print(ans)
  


### FIXED CODE ###

from bisect import bisect

a, b, q = [int(i) for i in input().split()]
s = []
for i in range(a):
	s.append(int(input()))
s = [-float('inf')] + s + [float('inf')]
t = []
for i in range(b):
	t.append(int(input()))
t = [-float('inf')] + t + [float('inf')]
x = []
for i in range(q):
	x.append(int(input()))

for xx in x:
  
  s_i = bisect(s,xx)
  s_r = abs(xx - s[s_i])
  s_l = abs(xx - s[s_i-1])
  t_i = bisect(t,xx)
  t_r = abs(xx - t[t_i])
  t_l = abs(xx - t[t_i-1])

  
  #print(s_l,s_r,t_l,t_r)
  
  #l = max(s_l,t_l)
  #r = max(s_r,t_r)
  if s_l <= t_l:
    l = t_l
    lr = s_l*2 + t_r
  else:
    l = s_l
    lr = t_l*2 + s_r
  if s_r <= t_r:
    r = t_r
    rl = s_r*2 + t_l
  else:
    r = s_r
    rl = t_r*2 + s_l
 
  ans = min(l,r,lr,rl)
  print(ans)
### BUGGY CODE ###

# coding: utf-8 
r, g, b, n = map(int, input().split())
a = [r, g, b]
a.sort()
cnt = 0
for i in range(n//a[2]+1):
    for j in range(n//a[1]+1):
        if n-i*a[2]-j*a[1]>=0 and (n-i*a[2]-j*a[1])%a[0]==0:
            cnt+=1
print(cnt)


### FIXED CODE ###

# coding: utf-8 
r, g, b, n = map(int, input().split())
cnt = 0
for i in range(n//r+1):
    for j in range((n-i*r)//g+1):
        if (n-i*r-j*g)%b==0:
            cnt+=1
print(cnt)
### BUGGY CODE ###

def f(n):
  cnt = 0
  for i in range(int((n-3)**1/2 //1)):
    for j in range(int((n-i**2)**1/2 //1)):
      for k in range(int((n-i**2-j**2)**1/2 //1)):
        if (i+1)**2 + (j+1)**2 + (k+1)**2 + (i+1)*(j+1) + (j+1)*(k+1) + (k+1)*(i+1) == n:
          cnt += 1
  return cnt
    
N = int(input())
for i in range(N):
  print(f(i+1))

### FIXED CODE ###

n = int(input())
a = [0]*n
cnt = 0
for i in range(1,100):
  for j in range(1,100):
    for k in range(1,100):
      b = i**2 + j**2 + k**2 + i*j + j*k + k*i
      if b <= n:
        a[b-1] += 1

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

w=input()
a=[(i+1)*(j=="0") for i,j in enumerate(w)]
b=[(i+1)*(j=="1") for i,j in enumerate(w)]
l=len(w)
w=list(w)
for t in range(1,l+1):
	m=min(max(a[:t]),max(b[:t]))
	if l-m<t:
		print(t-1)
		exit()
print(l)

### FIXED CODE ###

w=input()
a=[(i+1)*(j=="0") for i,j in enumerate(w)]
b=[(i+1)*(j=="1") for i,j in enumerate(w)]
l=len(w)
ma=a[0];mb=b[0]
for t in range(1,l+1):
	ma=max(ma,a[t-1])
	mb=max(mb,b[t-1])
	m=min(ma,mb)
	if l-m<t:
		print(t-1)
		exit()
print(l)
### BUGGY CODE ###

n = int(input())
sl = list(input() for _ in range(n))

sl_s = sorted(list(set(sl)))

if len(sl_s) == 1:
    print(sl[0])
else:
    ans = []
    count = 1
    for s in sl_s:
        if sl.count(s) == count and ans.count(s) == 0:
            ans.append(s)
        elif sl.count(s) > count and ans.count(s) == 0:
            ans.clear()
            ans.append(s)
            count = sl.count(s)
    print('\n'.join(ans))

### FIXED CODE ###

from collections import Counter

n = int(input())
sl = list(input() for _ in range(n))

cnt = Counter(sl)
# print('cnt:', cnt)
maxNum = max(cnt.values())
# print('maxNum:', maxNum)

ans = []
for k, v in cnt.items():
    if v == maxNum:
        ans.append(k)

ans.sort()
print('\n'.join(ans))
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
p = 1
for i in range(n):
    p *= a[i]
if p > int(1E18):
    print(-1)
else:
    print(p)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
p = 1
if a.count(0):
    print(0)
    exit(0)
for i in range(n):
    p *= a[i]
    if p > int(1E18):
        print(-1)
        exit(0)
print(p)
### BUGGY CODE ###

k,s = map(int,input().split())
c = 0

for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i+j+l == s:
                c += 1
print(c)

### FIXED CODE ###

k,s = map(int,input().split())
c = 0

for y in range(k+1):
    for z in range(k+1):
        if 0 <= s-(y+z) <= k:
            c += 1
print(c)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)

n = int(input())
a = list(map(int, input().split()))
d = [None]*n**2
def judge(l,r):
  if l >= r: return a[l]
  v = l + r*n
  if d[v] is not None: return d[v] 
  d[v] = max(a[l] - judge(l+1,r), a[r] - judge(l,r-1))
  return d[v]

print(judge(0,n-1))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
dp = [[None]*n for _ in range(n)]
for d in range(n):
  for l in range(n-d):
    r = l + d
    if d:
      dp[l][r] = max(a[l] - dp[l+1][r], a[r] - dp[l][r-1])
    else:
      dp[l][r] = a[l]
print(dp[0][n-1])
### BUGGY CODE ###

N = int(input())
X = str(input())

from functools import lru_cache


def popcount(bits: str):
    return len([elm for elm in bits if elm == '1'])


cache = dict()

@lru_cache(maxsize=200000)
def f(num):
    if num == 0:
        return 0
    else:
        # if not cache.get(num % pc, None) is None:
        #     return cache[num % pc]
        pc = popcount('{:b}'.format(num))
        ret = 1 + f(num % pc)
        # cache[num % pc] = ret
        return ret


def reverse_bit(bits: str, digit):
    def toggle(a):
        if a == '1':
            return '0'
        else:
            return '1'

    ret = list(bits)
    ret[digit-1] = toggle(bits[digit-1])
    return ''.join(ret)

def convert(x: str):
    ans = 0
    i = 0
    for elm in list(x)[::-1]:
        if elm == '1':
            ans += 2 ** i
        i += 1
    return ans


answers = {}

for i in range(1, N+1):
    bits = reverse_bit(X, i)
    # pc = popcount(bits)
    # print(f'# {bits} {convert(bits)} {pc}')
    x = convert(bits)
    if not answers.get(x, None) is None:
        print(answers[x])
        continue
    ret = f(x)
    answers[x] = ret
    print(ret)

### FIXED CODE ###

n = int(input())
# for i in range(n):
#     print('0', end='')
# print(flush=True)
s = input()
x = int(s, base=2)
popcount = s.count('1')
y_zero = x % (popcount + 1)
if popcount > 1:
    y_one = x % (popcount - 1)
dp = [-1] * n
dp[0] = 0
 
 
def calc(y):
    if dp[y] != -1:
        return dp[y]
    dp[y] = 1 + calc(y % bin(y).count('1'))
    return dp[y]
 
 
ans = [0] * n
rem_zero = 1
if popcount > 1:
    rem_one = popcount - 2
for i in range(n):
    if s[n - 1 - i] == '0':
        ans[n - 1 - i] = 1 + calc((y_zero + rem_zero) % (popcount + 1))
    elif popcount > 1:
        ans[n - 1 - i] = 1 + calc((y_one + rem_one) % (popcount - 1))
    else:
        ans[n - 1 - i] = 0
    rem_zero = rem_zero * 2 % (popcount + 1)
    if popcount > 1:
        rem_one = rem_one * 2 % (popcount - 1)
for i in range(n):
    print(ans[i])
### BUGGY CODE ###

n,k,q =  list(map(int, input().split()))
a = [int(input()) for i in range(q)]
import numpy as np
p = np.ones(n) * k

for i in range(len(a)):
    for j in range(len(p)):
        if j != a[i]-1:
            p[j] -= 1

for i in range(len(p)):
    if p[i] > 0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

n,k,q =  list(map(int, input().split()))
a = [int(input()) for i in range(q)]
import numpy as np
p = np.ones(n) * (k-q)

for i in range(q):
    p[a[i]-1] += 1

for i in range(len(p)):
    if p[i] > 0:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

N = int(input())
a=list(map(int, input().split()))
Q = int(input())
num_a =[0]*100001
b=[]
c=[]
for i in range(Q):
  b1,c1=map(int, input().split())
  b.append(b1)
  c.append(c1)
for i in range(Q):
  if b[i] not in a:
    continue
  elif num_a[b[i]]>0:
    continue
  else:
    num_a[b[i]] = a.count(b[i])
num_b = []
for i in range(Q):
  if num_a[b[i]]==0:
    num_b.append(0)
  else:
    num_b.append(num_a[b[i]])
    num_a[c[i]] += num_a[b[i]]
    num_a[b[i]] = 0
sum_a = sum(a)
for i in range(Q):
  sum_a = sum_a - b[i]*num_b[i] +c[i]*num_b[i]
  print(sum_a)

### FIXED CODE ###

N = int(input())
a=list(map(int, input().split()))
Q = int(input())
num_a =[0]*100001
num_b = []
sum_a = sum(a)
b=[]
c=[]
for i in a:
  num_a[i]+= 1
for i in range(Q):
  b1,c1=map(int, input().split())
  b.append(b1)
  c.append(c1)
for i in range(Q):
  if num_a[b[i]]==0:
    num_b.append(0)
    sum_a = sum_a - b[i]*num_b[i] +c[i]*num_b[i]
  else:
    num_b.append(num_a[b[i]])
    num_a[c[i]] += num_a[b[i]]
    num_a[b[i]] = 0
    sum_a = sum_a - b[i]*num_b[i] +c[i]*num_b[i]
  print(sum_a)
### BUGGY CODE ###

# input
N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

ans = 0

for i in range(N):
    for j in range(N):
        if B[j] > A[i]:
            for k in range(N):
                if C[k] > B[j]:
                    ans += N - k
                    break

print(ans)


### FIXED CODE ###

import bisect as bi

# input
N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

count = 0

for b in B:
    i = bi.bisect_left(A, b) # A[0],...,A[i - 1] < b
    k = bi.bisect_right(C, b) # b < C[k],...C[N-1]
    count += i * (N - k)

print(count)
### BUGGY CODE ###

import math

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

for i in range(1, round(math.pow(P, 1 / N)) + 1):
    if P % (i ** N) == 0:
        now_max = i

print(now_max)

### FIXED CODE ###

n, p = map(int, input().split())
if n == 1:
    print(p)
else:
    for i in range(1, round(p**(1/n))+1):
        if p % i**n ==0:
            res = i
    print(res)
### BUGGY CODE ###

N = int(input())
S = list(sorted(map(int,input().split())))

cnt = 0
for i in range(N-2):
  for j in range(i+1,N-1):
    for k in range(j+1,N):
      # print("{} {} {} {} {} {}".format(i,j,k,S[i],S[j],S[k]))
      if S[i]+S[j] <= S[k]:
        #print("break")
        cnt += k-j-1
        break 
    else:
      cnt += k-j
         
        
print(cnt)

### FIXED CODE ###

N = int(input())
S = list(sorted(map(int,input().split())))
cnt = 0
for j in range(1,N-1):
  k=j+1
  for i in range(j):
    while True:
      
      if k == N or S[i]+S[j] <= S[k]:
        k-=1
        break
      k+=1
    #print(i,j,k)
    #print(S[i],S[j], S[j+1:k+1],k-j)
    cnt += k-j
print(cnt)
### BUGGY CODE ###

n=int(input())
a=[int(i) for i in input().split()]
a.sort()
q=int(input())
bc=[]
for i in range(q):
    bc.append([int(i) for i in input().split()])

import collections
collect = collections.Counter(a)

for i in bc:
    if i[1] in collect:
        collect[i[1]] += collect.pop(i[0],0)
    else:
        if i[0] in collect:
            collect[i[1]] = collect.pop(i[0],0)
    ans=0
    for k,v in collect.items():
        ans += (k * v)
    print(ans)

### FIXED CODE ###

#sum を計算しておく
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
q=int(input())
bc=[]
for i in range(q):
    bc.append([int(i) for i in input().split()])

import collections
collect = collections.Counter(a)

ans=0
for k,v in collect.items():
    ans += (k * v)
for i in bc:
    if i[0] in collect:
        if i[1] in collect:
            ans += ((i[1]-i[0]) * collect[i[0]])
            collect[i[1]] += collect.pop(i[0],0)
        else:
            ans += ((i[1]-i[0]) * collect[i[0]])
            collect[i[1]] = collect.pop(i[0],0)
    print(ans)
### BUGGY CODE ###

from collections import Counter
n = int(input())
nmax = 10**6+10
eratos = [0 for i in range(nmax+1)]
prime = []
cnt = 2
while True:
  while cnt <= nmax and eratos[cnt]:
    cnt += 1
  if cnt > nmax:
    break
  eratos[cnt] = 1
  prime.append(cnt)
  for i in range(cnt**2,nmax+1,cnt):
    eratos[i] = 1
pr = []
while n > 1:
  for i in prime:
    while n%i == 0:
      n //= i
      pr.append(i)
c = Counter(pr)
ans = 0
for i in c.values():
  for j in range(10):
    if i < j*(j+1)//2:
      ans += j-1
      break
print(ans)

### FIXED CODE ###

from collections import Counter
n = int(input())
nmax = 10**6+10
eratos = [0 for i in range(nmax+1)]
prime = []
cnt = 2
while True:
  while cnt <= nmax and eratos[cnt]:
    cnt += 1
  if cnt > nmax:
    break
  eratos[cnt] = 1
  prime.append(cnt)
  for i in range(cnt**2,nmax+1,cnt):
    eratos[i] = 1
pr = []
for i in prime:
  while n%i == 0:
    n //= i
    pr.append(i)
if n > 1:
  pr.append(n)
c = Counter(pr)
ans = 0
for i in c.values():
  for j in range(10):
    if i < j*(j+1)//2:
      ans += j-1
      break
print(ans)