Harryxun/stf_run huggingface dataset:
N = int(input())
src = list(map(int,input().split()))

cands = list(sorted(set(src)))

def enough(i):
    bit = [0] * (2*N+10)
    def bit_add(a,w):
        x = a
        while x <= (2*N+9):
            bit[x] += w
            x += (x & -x)
    def bit_sum(a):
        x = a
        ret = 0
        while x > 0:
            ret += bit[x]
            x -= (x & -x)
        return ret

    cums = [0]
    for a in src:
        tmp = 1 if a >= cands(i) else -1
        cums.append(cums[-1] + tmp)

    cnt = 0
    for i in range(N+1):
        a = cums[i] + N+5
        cnt += bit_sum(a)
        bit_add(a, 1)
    return cnt*2 >= N*(N+1)//2

ok = 0
ng = len(cands)
while ng - ok > 1:
    m = (ok+ng)//2
    if enough(m):
        ok = m
    else:
        ng = m
print(ok)

### FIXED CODE ###

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

cands = list(sorted(set(src)))

def enough(i):
    bit = [0] * (2*N+10)
    def bit_add(a,w):
        x = a
        while x <= (2*N+9):
            bit[x] += w
            x += (x & -x)
    def bit_sum(a):
        x = a
        ret = 0
        while x > 0:
            ret += bit[x]
            x -= (x & -x)
        return ret

    cums = [0]
    for a in src:
        tmp = 1 if a >= cands[i] else -1
        cums.append(cums[-1] + tmp)

    cnt = 0
    for i in range(N+1):
        a = cums[i] + N+5
        cnt += bit_sum(a)
        bit_add(a, 1)
    return cnt*2 >= N*(N+1)//2

ok = 0
ng = len(cands)
while ng - ok > 1:
    m = (ok+ng)//2
    if enough(m):
        ok = m
    else:
        ng = m
print(cands[ok])
N = int(input())
A = list(map(int,input().split()))

n = 30
D = [0]*n

for i in range(N):
    s = list(bin(A[i])[2:])[::-1]
    for j in range(len(s)):
        D[j] += int(s[j])
ans = 0
for i in range(n):
    ans += D[i]*(N-D[i])*2**i
    ans %= 10**9+7
print(ans)


### FIXED CODE ###

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

n = 62
D = [0]*n

for i in range(N):
    s = list(bin(A[i])[2:])[::-1]
    s = [i for i in range(len(s)) if s[i]=='1']
    for j in s:
        D[j] += 1
ans = 0
for i in range(n):
    ans += D[i]*(N-D[i])*2**i
    ans %= 10**9+7
print(ans)
K, N = map(int, input().split())
A = list(map(int, input().split()))

A.append(A[0]+K)

for i in K:
  L = A[i+1]-A[i]
ans = K-max(L)

print(ans)




### FIXED CODE ###

K, N = map(int, input().split())
A = list(map(int, input().split()))

A.append(A[0]+K)
L = []

for i in range(N):
  a = A[i+1]-A[i]
  L.append(a)
ans = K-max(L)

print(ans)
N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
    print('{0} x {1}'.format(v, s.count(v)))

### FIXED CODE ###

N=int(input())
if N%1000==0:
    print(0)
else:
    print(1000-N%1000)
N=int(input())
A=list(map(int,input().split()))
if N%2==0:
    n1=0
    n2=0
    for i in range(N):
        if i%2==0:
            n1=n1+A[i]
        else:
            n2=n2+A[i]
    #print(max(n1,n2))
else:
    #print(A[0],A[1])
    dp=[[-float("inf") for _ in range(3)] for _ in range(N+10)]
    if N==3:
        print(max(A[0],A[1],A[2]))
    else:
        for i in range(N):
            if i<3:
                if i==0:
                    dp[i][0]=A[0]
                if i==1:
                    dp[i][1]=A[0]
                    dp[i][0]=A[1]
                if i==2:
                    dp[i][2]=A[2]
                    dp[i][1]=A[1]
                    dp[i][0]=A[0]+A[2]
                if i==3:
                    dp[i][0]=dp[1][0]+A[3]
                    dp[i][1]=max(dp[1][1]+A[3],dp[0][0]+A[3])
                    dp[i][2]=max(dp[1][2]+A[3],dp[0][1]+A[3])
            else:
                for j in range(3):
                    if j==0:#ここでも2こずつ規則よく飛ばすと決めた
                        dp[i][0]=max(dp[i][0],dp[i-2][0]+A[i])
                    elif j==1:#1回だけ無茶した
                        dp[i][1]=max(dp[i][1],dp[i-2][1]+A[i],dp[i-3][0]+A[i])
                    else:
                        dp[i][2]=max(dp[i][2],dp[i-2][2]+A[i],dp[i-3][1]+A[i],dp[i-4][0]+A[i])
print(max(dp[N-1]))

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
if N%2==0:
    dp=[[-float("inf") for _ in range(2)] for _ in range(N+10)]
    if N==2:
        print(max(A[0],A[1]))
    else:
        for i in range(N):
            if i==0:
                dp[i][0]=A[0]
            elif i==1:
                dp[i][1]=A[1]
            elif i==2:
                dp[i][0]=A[0]+A[2]
            else:
                for j in range(2):
                    if j==0:
                        dp[i][0]=max(dp[i][0],dp[i-2][0]+A[i])
                    elif j==1:
                        dp[i][1]=max(dp[i][1],dp[i-2][1]+A[i],dp[i-3][0]+A[i])
        print(max(dp[N-1]))
else:
    #print(A[0],A[1])
    dp=[[-float("inf") for _ in range(3)] for _ in range(N+10)]
    if N==3:
        print(max(A[0],A[1],A[2]))
    else:
        for i in range(N):
            if i<4:
                if i==0:
                    dp[i][0]=A[0]
                if i==1:
                    dp[i][1]=A[1]
                if i==2:
                    dp[i][2]=A[2]
                    dp[i][0]=A[0]+A[2]
                if i==3:
                    dp[i][1]=max(dp[1][1]+A[3],dp[0][0]+A[3])
            else:
                for j in range(3):
                    if j==0:#ここでも2こずつ規則よく飛ばすと決めた
                        dp[i][0]=max(dp[i][0],dp[i-2][0]+A[i])
                    elif j==1:#1回だけ無茶した
                        dp[i][1]=max(dp[i][1],dp[i-2][1]+A[i],dp[i-3][0]+A[i])
                    else:
                        dp[i][2]=max(dp[i][2],dp[i-2][2]+A[i],dp[i-3][1]+A[i],dp[i-4][0]+A[i])
        print(max(dp[N-1]))
a,b = map(int,input().split())
if (a != 0) and (b != 0):
    print(str(int(a*(a-1)/2 + b*(b-1)/2)))
elif (a == 0) and (b == 0):
    print("0")      
elif (a == 0) and (b != 0):
    print(str(int(b*(b-1)/2)))
else:
    print(str(inr(a*(a-1)/2)))

### FIXED CODE ###

a,b = map(int,input().split())
if (a != 0) and (b != 0):
    print(str(int(a*(a-1)/2 + b*(b-1)/2)))
elif (a == 0) and (b == 0):
    print("0")      
elif (a == 0) and (b != 0):
    print(str(int(b*(b-1)/2)))
else:
    print(str(int(a*(a-1)/2)))
N, K = map(int, input().split())
    A = list(map(int, input().split()))
    F = list(map(int, input().split()))
    A.sort()
    F.sort(reverse=True)
     
    l = 0
    r = max(a * f for a, f in zip(A, F))
     
    while l < r:
        m = (l + r) // 2
        if sum(max(a - m // f, 0) for a, f in zip(A, F)) <= K:
            r = m
        else:
            l = m + 1
     
    print(r)

### FIXED CODE ###

import numpy as np

N, K = map(int, input().split())
A = np.array(input().split(), np.int64)
F = np.array(input().split(), np.int64)
A.sort()
F.sort()
F = F[::-1]

l = 0
r = (A * F).max()

while l < r:
    m = (l + r) // 2
    if np.maximum(A - m // F, 0).sum() <= K:
        r = m
    else:
        l = m + 1

print(r)
N = int(input())
S = input()
m = 10**9 + 7
nl = [0 for i in range(26)]
for s in S:
    nl[ord(s)-97] += 1
ans = 1
for i in range(N):
    if nl[i] == 0:
        continue
    else:
        ans *= nl[i] + 1
        ans = ans % m
print(ans-1)


### FIXED CODE ###

N = int(input())
S = input()
m = 10**9 + 7
nl = [0 for i in range(26)]
for s in S:
    nl[ord(s)-97] += 1
ans = 1
for i in range(26):
    if nl[i] == 0:
        continue
    else:
        ans *= nl[i] + 1
        ans = ans % m
print(ans-1)
N = int(input())
A = list(map(int,input().split()))
over_value = 10 ** 18 + 1
total = 1
if A.index(0):
    print(0)
else:
    for i in A:
        total *= i
    if total > over_value:
        total = -1
    print(total)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
over_value = 10 ** 18
total = 1
cnt = 0
while cnt < N:
    total *= A[cnt]
    if total > over_value:
        total = -1
        break
    cnt += 1
    
for i in range(N):
    if A[i] == 0:
        total = 0
print(total)
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = miin(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (ciel(a / 10) + ciel(b / 10)+ ciel(c / 10)+ ciel(d / 10)+ ciel(e / 10)) - (10 - sub)
print(time)



### FIXED CODE ###

import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = min([m % 10 for m in [a,b,c,d,e] if m % 10 != 0] + [10])
time = 10 * (math.ceil(a / 10) + math.ceil(b / 10)+ math.ceil(c / 10)+ math.ceil(d / 10)+ math.ceil(e / 10)) - (10 - sub)
print(int(time))
n = int(input())
A = map(int, input().split())

for i in range(1, n):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = v
    print(A)


### FIXED CODE ###

def insertionsort(A, n):
    for i in range(1, n):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        prt(A)

def prt(A):
    for i in A:
        if i != A[len(A)-1]: print(i, end=" ")
        else: print(i)

n = int(input())
A = input().split()
A = [int(i) for i in A]
prt(A)
insertionsort(A, n)
n = input()
A = map(int, input().split())
q = input()
m = map(int, input().split())

def solve(i, m):
 if i == m:
  return true
 if i > n:
  return false
 res = solve(i + 1, m) || solve(i + 1, m - A[i])
  return res
 
for j in range(0, q-1):
 if m == solve(j, m(j)):
  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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'
import math
a,b,c=input().split(' ')
a=int(a)
b=int(b)
c=int(c)
if ((math.sqrt(a)+math.sqrt(b))<math.sqrt(c):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b,c=input().split(' ')
a=int(a)
b=int(b)
c=int(c)
if (c-a-b>0) and ((c-a-b)**2>4*a*b):
  print("Yes")
else:
  print("No")
import numpy as np

N = int(input())
A = np.array([int(i) for i in input().split()])
A = A[A<=2*(10**5)]

H = [0]*(5*(10**5))
L = [0]*(5*(10**5))

for i in range(N):
    H[A[i]+i] += 1
    if i-A[i] >= 0:
        L[i-A[i]] += 1

ans = 0

for i in range(N):
    ans += H[i]*L[i]

print(ans)


### FIXED CODE ###

import numpy as np

N = int(input())
A = np.array([int(i) for i in input().split()])

H = [0]*(5*(10**5))
L = [0]*(5*(10**5))

for i in range(N):
    if A[i] <= 2*(10**5):
        H[A[i]+i] += 1
    if i-A[i] >= 0:
        L[i-A[i]] += 1

ans = 0

for i in range(5*(10**5)):
    ans += H[i]*L[i]

print(ans)
raw_input = input()
input_list = inp.split()   

coding_contest_rank = int(input_list[0])
robot_rank = int(input_list[1])

if coding_contest_rank == 3 or robot_rank == 3:
  coding_money = 100000
  robot_money = 100000
elif coding_contest_rank == 2 or robot_rank == 2:
  coding_money = 200000
  robot_moeny = 200000
elif coding_contest_rank == 1 or robot_rank == 1:
  coding_money = 300000
  robot_moeny = 300000
elif coding_contest_rank == 1 and robot_rank == 1:
  print(1000000)
  break

print(coding_money + robot_money)
  

  

### FIXED CODE ###

raw_input = input()
input_list = raw_input.split()   
 
coding_contest_rank = int(input_list[0])
robot_rank = int(input_list[1])


if coding_contest_rank == 3:
    coding_money = 100000
if robot_rank == 3:
    robot_money = 100000
if coding_contest_rank == 2:
    coding_money = 200000
if robot_rank == 2:    
    robot_money = 200000
if coding_contest_rank == 1:
    coding_money = 300000
if robot_rank == 1:    
    robot_money = 300000
if coding_contest_rank > 3:
    coding_money = 0
if robot_rank > 3:
    robot_money = 0

if coding_contest_rank == 1 and robot_rank == 1: 
    print(coding_money + robot_money + 400000)
else:
    print(coding_money + robot_money)
H, W = map(int, input().split())
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
S = [list(map(int, input().split())) for _ in range(H)]
for i in range(H):
  for j in range(W):
    if S[i][j] == "snuke":
      print("{}{}".format(alpha[j], i+1))

### FIXED CODE ###

H, W = map(int, input().split())
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
S = [list(map(str, input().split())) for _ in range(H)]
for i in range(H):
  for j in range(W):
    if S[i][j] == "snuke":
      print("{}{}".format(alpha[j], i+1))
import itertools

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

print(sum([d[i - 1] * d[j - 1] for i, j in list(itertools.combinations(d, 2))]))

### FIXED CODE ###

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

out = 0
for i in range(N):
    for j in range(i + 1, N):
        out += d[i] * d[j]

print(out)
NM=list(map(int,input().split()))
N=NM[0]
M=NM[1]
graph=[[] for j in range(N)]
 
for i in range(M):
  edge=list(map(int,input().split()))
  graph[edge[0]-1].append(edge[1]-1)
  
ST=list(map(int,input().split()))
S=ST[0]-1
T=ST[1]-1
 
 
 
first=[]
second=[]
third=[]
able=set([S])
 
step=0
 
while True:
  first=[]
  second=[]
  third=[]
  judge = 0
  for i in range(len(able)):
    for j in range(len(graph[able[i]])):
      if not (graph[able[i]][j] in first):
        first.append(graph[able[i]][j])
  for i in range(len(first)):
    for j in range(len(graph[first[i]])):
      if not (graph[first[i]][j] in second):
        second.append(graph[first[i]][j])
  for i in range(len(second)):
    for j in range(len(graph[second[i]])):
      if not (graph[second[i]][j] in third):
        third.append(graph[second[i]][j])
  able=able&set(third)
  if judge == 0:
    print(-1)
    break
  step+=1
  if T in able:
    print(step)
    break

### FIXED CODE ###



import sys
from collections import deque, defaultdict
import copy
import bisect
#sys.setrecursionlimit(10 ** 9)
import math
import heapq
from itertools import combinations, permutations

import sys
def input():
	return sys.stdin.readline().strip()


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

graph = [[] for _ in range(3*N)]

for i in range(M):
	u, v = list(map(int, input().split()))
	u -= 1
	v -= 1
	graph[u%(3*N)].append((v + N)%(3*N))
	graph[(u + N) % (3 * N)].append((v+2*N)%(3*N))
	graph[(u + 2*N) % (3 * N)].append(v % (3 * N))
S, T = list(map(int, input().split()))
S -= 1
T -= 1

dist = [1000000000000000000 for _ in range(3*N)]
que = deque([])
que.append(S)
dist[S] = 0
while len(que) > 0:
	node = que.popleft()
	for edge in graph[node]:
		if dist[edge] > dist[node] + 1:
			dist[edge] = dist[node] + 1
			que.append(edge)

if dist[T] < 100000000000000:
	print(dist[T]//3)
else:
	print(-1)
n = int(input())
s = n//2
k = s-k
print(s*k)

### FIXED CODE ###

n = int(input())
s = n//2
k = n-s
print(s*k)
def D_abs(N, Z, W, A):
    if N == 1:
        # Xは山札のたった1枚を引かねばならず、Yは山札から1枚も引けないから
        return abs(A[0] - W)
    else:
        # 山札は一番上しか見れないので、
        # Xがa_{N-1}を持ち、Yがa_{N}を持つか、
        # Xがa_{N}を持ち、YがWまたはa_{N-1}を持つかの
        # どちらかで終了する。
        return max(abs(A[N - 1] - W), abs(A[N - 1] - A[N - 2]))

N,Z,W = [int(_) for _ in input().split()]
A = [int(input()) for _ in range(N)]
print(D_abs(N, Z, W, A))

### FIXED CODE ###

def D_abs(N, Z, W, A):
    if N == 1:
        # Xは山札のたった1枚を引かねばならず、Yは山札から1枚も引けないから
        return abs(A[0] - W)
    else:
        # 山札は一番上しか見れないので、
        # Xがa_{N-1}を持ち、Yがa_{N}を持つか、
        # Xがa_{N}を持ち、YがWまたはa_{N-1}を持つかの
        # どちらかで終了する。
        return max(abs(A[N - 1] - W), abs(A[N - 1] - A[N - 2]))

N,Z,W = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
print(D_abs(N, Z, W, A))
a,b,c=map(int,input().split())

if a+b+c==17 and a*b*c==175:
　print("YES")
else:
　print("NO")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b+c==17 and a*b*c==175:
 print("YES")
else:
 print("NO")
n = int(input())
playlists = []

for _ in range(n):
    title, playtime = input().split()
    playlists.append([title, int(playtime)])

lastmusic = input()

print(sum([x[1] for x in playlists[playlists[0].index(lastmusic) + 1:]]))

### FIXED CODE ###

music_num = int(input())
music_list = []

for i in range(music_num):
    music_list.append(input().split(' '))

sleep_timing_music = input()
flag = False
sleep_time = 0

for j in music_list:
    if flag == True:
        sleep_time += int(j[1])
        
    if j[0] == sleep_timing_music:
        flag = True

print(sleep_time)
a = int(input())
if a == 'A':
	print('A')
elif a == 'C':
	print('T')
elif a == 'G'
	print('C')
elif a == 'T':
  	print('G')

### FIXED CODE ###

a = input()
if a == 'A':
  print('T')
elif a == 'C':
  print('G')
elif a == 'G':
  print('C')
elif a == 'T':
  print('A')
import math

def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

#bisect.bisect_left(list,key)はlistのなかでkey未満の数字がいくつあるかを返す
#bisect.bisect_right(list, key)はlistのなかでkey以下の数字がいくつあるかを返す
#これを応用することで
#len(list) - bisect.bisect_left(list,key)はlistのなかでkey以上の数字がいくつあるかを返す
#len(list) - bisect.bisect_right(list,key)はlistのなかでkeyより大きい数字がいくつあるかを返す
#これらを使うときはあらかじめlistをソートしておくこと！

n,k = MI()
a = LI()

def cutting_isOK(x,li,k):
    ans = 0
    for i in range(n):
        ans += math.ceil(li[i]/x) - 1
    if ans <= k:
        return True
    else:
        return False
left = -1
right = 10**9+1
while right != left + 1:
    mid = (left+right)//2
    if cutting_isOK(mid,a,k):
        right = mid
    else:
        left = mid
print(right)



### FIXED CODE ###

def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

n = I()
c = list(input())
r = c.count('R')
print(c[:r].count("W"))
n=int(input())
e=[0]*(n+1)
count=0
ijklist={}
for i in range(2, n+1):
    cur = i
    for j in range(2, i + 1):
        while cur % j == 0:
            e[j] += 1
            cur //= j
for i in range(n+1):
    for j in range(i+1,n+1):
        for k in range(j+1,n+1):
            if e[i]>=4 and e[j]>=4 and e[k]>=2:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
            elif e[i]>=14 and e[j]>=4 and e[k]==0:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
            elif e[i]>=24 and e[j]>=2 and e[k]==0:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
            elif e[i]>=74 and e[j]==0 and e[k]==0:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
print(count)



### FIXED CODE ###

N = int(input())
e = [0] * (N+1)
for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
         while cur % j == 0:
            e[j] += 1
            cur //= j

def num(m):
    return len(list(filter(lambda x: x >= m-1, e)))

print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)+ num(5) * (num(5) - 1) * (num(3) - 2) // 2)
A, B, C, D =map(int,input().split())

N_list = list(range(A, B+1))

ans = 0
for i in range(len(N_list)):
    if N_list[i] % C == 0:
        ans = ans
    elif N_list[i] % D == 0:
        ans = ans
    else:
        ans = ans +1

print(ans)

### FIXED CODE ###

A, B, C, D =map(int,input().split())

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

def lcm(a, b):
    return a * b // gcd (a, b)

ans =(B-A+1)-(B//(C)-(A-1)//C+B//(D)-(A-1)//D-B//lcm(C,D)+(A-1)//lcm(C,D))
print(ans)
import sys
import numpy as np
# inputを高速化する。
input = sys.stdin.readline

n,k=map(int,input().split())
h=list(map(int,input().split()))
INF=10**10
cost=[INF]*(n+1)
cost[0]=0

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

print(cost[n-1])

### FIXED CODE ###

import sys
# inputを高速化する。
input = sys.stdin.readline

n,k=map(int,input().split())
h=list(map(int,input().split()))
INF=10**10
cost=[INF]*(n+1)
cost[0]=0

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

print(cost[n-1])
n = int(input())
a = list(input())
b = list(input())
c = list(input())

ans = 0
for i in range(n):
  aa = a[i]
  bb = b[i]
  cc = c[i]
  if len(set([a,b,c])) == 1:
    continue
  elif len(set([a,b,c])) == 2:
    ans += 1
  else:
    ans += 2
print(ans)

### FIXED CODE ###

n = int(input())
a = list(input())
b = list(input())
c = list(input())

ans = 0
for i in range(n):
  aa = a[i]
  bb = b[i]
  cc = c[i]
  if len(set([aa,bb,cc])) == 1:
    continue
  elif len(set([aa,bb,cc])) == 2:
    ans += 1
  else:
    ans += 2
print(ans)
[].pop()

### FIXED CODE ###

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

ex = [1]
mod = 10**9+7
for i in range(1,10**5+1):
    ex.append((ex[-1]*i)%mod)
    
if abs(N-M) >= 2:
    print(0)
elif N==M:
    print((2*ex[N]**2)%mod)
else:
    print((ex[N]*ex[M])%mod)
def ceil(X, Y):  # 天井関数 ceil(X/Y) Y>1
    return (X + Y - 1) // Y


def binary(N):  # 二分探索 # N:探索要素数
    l, r = -1, N
    while r - l > 1:
        cnt = sum(ceil(ai, (l + r) // 2) - 1 for ai in a)
        if cnt <= k:  # 条件式を代入
            r = (l + r) // 2
        else:
            l = (l + r) // 2
    return r


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

print(binary(max(a)))


### FIXED CODE ###

def ceil(X, Y):  # 天井関数 ceil(X/Y) Y>1
    return (X + Y - 1) // Y


def binary(N):  # 二分探索 # N:探索要素数
    l, r = -1, N
    while r - l > 1:
        if (l + r) // 2 == 0:
            return 1
        cnt = sum(ceil(ai, (l + r) // 2) - 1 for ai in a)
        if cnt <= k:  # 条件式を代入
            r = (l + r) // 2
        else:
            l = (l + r) // 2
    return r


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

print(binary(max(a)))
N,D=map(int,input())
D2=D*D
c=0
for i in range(N):
  x,y =sprit(int,input())
  if x*x+y*y<=D2:
    c+=1
print(c)
  
  

### FIXED CODE ###

N,D=map(int,input().split())
D2=D*D
c=0
for i in range(N):
  x,y =map(int,input().split())
  if x*x+y*y<=D2:
    c+=1
print(c)
import math
a = list(map(int,input().split()))
print(math.gcd(a[0],a[1])

### FIXED CODE ###

a = input().split()
x = int(a[0])
y = int(a[1])
while y:
    x, y = y, x%y
print(x)
from collections import deque
N, M = map(int, input().split())
Inf = 10000000000
Edge = [[] for i in range(N)]
for i in range(M):
    l, r, d = map(int, input().split())
    Edge[l-1].append((r-1, d))
    Edge[r-1].append((l-1, -d))
 
Node = [Inf for i in range(N)]
Possible = True
for i in range(N):
    if not Possible:
        break
    elif Node[i] == Inf:
        Node[i] = 0
        Q = [i]
        while Q:
            now = deque.popleft(Q)
            for e in Edge[now]:
                if Node[e[0]] == Inf:
                    Node[e[0]] = Node[now] + e[1]
                    Q.append(e[0])
                elif Node[now] + e[1] != Node[e[0]]:
                    Possible = False
                    break
print("Yes" if Possible else "No")

### FIXED CODE ###

from collections import deque
N, M = map(int, input().split())
Inf = 10000000000
Edge = [[] for i in range(N)]
for i in range(M):
    l, r, d = map(int, input().split())
    Edge[l-1].append((r-1, d))
    Edge[r-1].append((l-1, -d))
 
Node = [Inf for i in range(N)]
Possible = True
for i in range(N):
    if not Possible:
        break
    elif Node[i] == Inf:
        Node[i] = 0
        Q = deque([i])
        while Q:
            now = Q.popleft()
            for e in Edge[now]:
                if Node[e[0]] == Inf:
                    Node[e[0]] = Node[now] + e[1]
                    Q.append(e[0])
                elif Node[now] + e[1] != Node[e[0]]:
                    Possible = False
                    break
print("Yes" if Possible else "No")
N = int(input())
s = [input().split() for i in range(3)]

A = [int(i) for i in s[0]]
B = [int(i) for i in s[1]]
C = [int(i) for i in s[2]]

sum1 = sum(B)

for i in range(N-1):
 if (A[i]+1) == A[i+1]:
     sum1 += C[A[i]-1]

print(sum1)

### FIXED CODE ###

n = int(input())
print(n*n*n)