Harryxun/stf_run huggingface dataset:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10**9)
INF = 10**9
mod = 10**9+7

A,B,C,D,E,F = I()
lim1 = F//(100*A)
lim2 = F//(100*B)
f = F-C
ans = 0
ansnum = 0
for i in range(lim1+1):
    for j in range(lim2+1):
        w = 100*i*A+100*j*B
        if i == j == 0:
            continue
        if w > f:
            continue
        r = F-w
        num = 0
        lim3 = min(r,(i*A+j*B)*E)//C
        for k in range(1,lim3+1):
            num = max(num,k*C+((min(r,(i*A+j*B)*E)-k*C)//D)*D)
        if 100*num/(w+num) > ansnum:
            ans = [w+num,num]
            ansnum = 100*num/(w+num)
print(*ans)

### FIXED CODE ###

import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10**9)
INF = 10**9
mod = 10**9+7

A,B,C,D,E,F = I()
lim1 = F//(100*A)
lim2 = F//(100*B)
ans = 0
ansnum = 0
for i in range(lim1+1):
    for j in range(lim2+1):
        w = 100*i*A+100*j*B
        if i == j == 0:
            continue
        if w > F:
            continue
        r = F-w
        num = 0
        lim3 = min(r,(i*A+j*B)*E)//C
        for k in range(lim3+1):
            num = max(num,k*C+((min(r,(i*A+j*B)*E)-k*C)//D)*D)
        if 100*num/(w+num) > ansnum:
            ans = [w+num,num]
            ansnum = 100*num/(w+num)
if ans == 0:
    print(A*100,0)
else:
    print(*ans)
import numpy as np
h,w,m = map(int,input().split())
bomb = list(tuple(map(lambda x: int(x)-1,input().split())) for i in range(m))
Map= np.zeros((h,w))
for i in bomb:
    Map[i] = 1
bombx = np.count_nonzero(Map,axis=1)
bomby = np.count_nonzero(Map,axis=0)
maxx = max(bombx)
maxy = max(bomby)
maxx_index = list(i for i in range(h) if bombx[i] == maxx)
maxy_index = list(i for i in range(w) if bomby[i] == maxy)
flag = 0
for i in maxx_index:
    for j in maxy_index:
        if Map[i][j] == 0:
            print(maxx+maxy)
            exit()
print(maxx+maxy-1)

### FIXED CODE ###

h,w,m = map(int,input().split())
bombX = [0]*h
bombY = [0]*w
bomb = set()
maxX = maxY = 0
for i in range(m):
    i,j = map(lambda x:int(x)-1, input().split())
    bomb.add((i,j))
    bombX[i] += 1
    bombY[j] += 1
    maxX = max(maxX,bombX[i])
    maxY = max(maxY,bombY[j])
maxX_index = list(i for i in range(h) if bombX[i] == maxX)
maxY_index = list(i for i in range(w) if bombY[i] == maxY)
for i in maxX_index:
    for j in maxY_index:
        if (i,j) in bomb: continue
        print(maxX+maxY)
        exit()
print(maxX+maxY-1)
N,K=map(int, input().split())

class UnionFindTree:
    def __init__(self, n):
        self.nodes = list(range(n+10))
    def find(self, x):
        if self.nodes[x] == x:
            return x
        parent = self.find(self.nodes[x])
        self.nodes[x] = parent
        return parent
    def unite(self, a, b):
        a = self.find(a)
        b = self.find(b)
        if a == b:
            return
        self.nodes[a] = self.nodes[b]
    def is_same(self, a, b):
        return self.find(a) == self.find(b)

uf = UnionFindTree(N)
for i in range(K):
    i,j,k=map(int, input().split())
    uf.unite(i,j)

st = set()
for i in range(1,N+1):
    par = uf.find(i)
    st.add(par)

print(len(st))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
N,K=map(int, input().split())

class UnionFindTree:
    def __init__(self, n):
        self.nodes = list(range(n+10))
    def find(self, x):
        if self.nodes[x] == x:
            return x
        parent = self.find(self.nodes[x])
        self.nodes[x] = parent
        return parent
    def unite(self, a, b):
        a = self.find(a)
        b = self.find(b)
        if a == b:
            return
        self.nodes[a] = self.nodes[b]
    def is_same(self, a, b):
        return self.find(a) == self.find(b)

uf = UnionFindTree(N)
for i in range(K):
    i,j,k=map(int, input().split())
    uf.unite(i,j)

st = set()
for i in range(1,N+1):
    par = uf.find(i)
    st.add(par)

print(len(st))
s=input()
a=False
for i,v in enumerate(s):
    if a==False:
        if v=="A":
            a=i
    else:
        if v=="Z":
            z=i
print(z-a+1)

### FIXED CODE ###

s=input()
ans=False
for i,v in enumerate(s):
    if ans==False:
        if v=="A":
            a=i
            ans=True
    else:
        if v=="Z":
            z=i
print(z-a+1)
a = input()
ans = a + (a ** 2) + (a ** 3)
print(ans)

### FIXED CODE ###

a = int(input())
ans = a + (a ** 2) + (a ** 3)
print(ans)
x, y, z, k = map(int, input().split())
m = []
for _ in range(3):
    m.append(sorted(list(map(int, input().split())), reverse=True))
 
def sorted_sum(list_a, list_b):
    s = []
    for x in list_a:
        for y in list_b:
            s.append(x + y)
    return sorted(s, reverse=True)
 
ans = sorted_sum(sorted_sum(m[0], m[1])[0:k], m[2])
for i in range(0, k):
    print(ans[i])

### FIXED CODE ###

def check(pos):
    for a in pos:
        for b in pos:
            if abs(a - b) > k:
                return False
    return True

pos = [None] * 5
for i in range(0, 5):
    pos[i] = int(input())
k = int(input())

print("Yay!" if check(pos) else ":(")
from fractions import gcd

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

lcm = a[0]
for i in a:
    lcm = lcm * i // gcd(lcm, i)
ans = 0
for i in a:
    ans += (lcm-1) % i
print(ans)


### FIXED CODE ###

a = list(map(int, input().split()))
a.sort()
print(a[2] - a[0])
n=int(input())

def euc(a,b):
  if a==b:
    return a
  else:
    return euc(max(a,b)-min(a,b),min(a,b))

mons=list(map(int,input().split()))
for i in range(n-1):
  p=euc(mons[i],mons[i+1])
  if p==1:
    ans=1
    break
  else:
    mons[i+1]=p

if ans==1:
  print(1)
else:
  print(mons[n-1])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
def euc(x,y):
  x,y=max(x,y),min(x,y)
  if x%y==0:
    return y
  else:
    return euc(y,x%y)
k=a[0]
for i in range(1,n):
  k=euc(a[i],k)
print(k)
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
import math

nin,k = getNM()
nums = getList()
dnum = math.floor(math.log2(max(nums+[k]))) + 2

onum = [0] *dnum

for n in nums:
    for i,c in enumerate(str(bin(n))[2:][::-1]):
        if c == "1":
            onum[i] += 1


znum = [nin-x for x in onum]
ans = 0
def greedy(digit):
    tmp = 0
    for i in range(digit):
        tmp += 2**i * (max([onum[i], znum[i]]))

    return tmp

def search(digit, cur):
    if (onum[digit]>=znum[digit]):
       # print("o",digit)
        return 2**digit * onum[digit] + greedy(digit)
    if (cur < 2 ** digit):
        #print(digit)
        return 2 ** digit * onum[digit] + search(digit-1, cur)
    else:
        #print("e",digit)
        e1 = 2**digit * onum[digit] + greedy(digit)
        e2 = 2**digit * znum[digit] + search(digit-1, cur-2**digit)
        return max([e1,e2])
#print(znum)
#print(onum)
print(search(dnum-1, k))

### FIXED CODE ###

import sys
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = float("inf")
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)

class BIT():
    # A1 ... AnのBIT(1-indexed)
    def __init__(self, n):
        self.n = n
        self.BIT = [0] * (n + 2)

    # A1 ~ Aiまでの和 O(logN)
    def query(self, idx):
        res_sum = 0
        while idx > 0:
            res_sum += self.BIT[idx]
            idx -= idx & (-idx)
        return res_sum

    # Ai += x O(logN)
    def update(self, idx, x):
        # print(idx)
        while idx <= self.n:
            # print(idx)
            self.BIT[idx] += x
            idx += idx & (-idx)
        return

    def show(self):
        print(self.BIT)


def solve():
    n, k = getList()
    lis = getList()
    ans = 0
    bind = True
    dp = [-1 ,0]
    for rui in range(50, -1, -1):
        tmp = [-1 ,0]
        tgt = pow(2, rui)
        bit = tgt & k
        u, d = 0, 0
        for num in lis:
            if num & tgt == tgt:
                u += 1
            else:
                d += 1
        # print(u, d)
        if bit == 0:
            tmp[1] = dp[1] + tgt * u
            if dp[0] != -1:
                tmp[0] = dp[0] + tgt * max(u, d)
        else:
            if dp[0] != -1:
                tmp[0] = dp[0] + tgt * max(u, d)
            tmp[0] = max(dp[1] + tgt * u, tmp[0])
            tmp[1] = dp[1] + tgt * d
        dp = tmp
        # print(dp, bit, u, d)
    print(max(dp))

def main():
    n = getN()
    for _ in range(n):
        solve()

    return
if __name__ == "__main__":
    # main()
    solve()
def solve():
    N = int(input())
    A = [0]*N
    B = [0]*N
    for i in range(N):
        A[i],B[i] = map(int, input().split())
    A.sort()
    B.sort(reverse=True)
    if N%2==1:
        mid = (N+1)//2-1
        ans = B[mid]-A[mid]+1
    else:
        mid1 = N//2-1
        mid2 = N//2
        ans = (B[mid1]+B[mid2])-(A[mid1]+A[mid2])+1
    return ans
print(solve())


### FIXED CODE ###

mod = 998244353
N, S = map(int, input().split())
A = list(map(int, input().split()))
dp = [[0]*(S+1) for _ in range(N+1)]
dp[0][0] = 1
for i in range(1,N+1):
    dp[i][0] = dp[i-1][0]*2%mod

for i in range(1,N+1):
    for j in range(1,S+1):
        dp[i][j] = dp[i-1][j]*2%mod
        if j>=A[i-1]:
            dp[i][j] += dp[i-1][j-A[i-1]]

ans = dp[-1][-1]%mod
print(ans)
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y<=576460752303423488 and Y>=576460752303423487:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

### FIXED CODE ###

X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y==576460752303423487:
  print(59)
  exit()
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)
n = input()
ans = 0
for i ih set(n):
  if n.count(i) % 2 == 0:
    ans += 1
    
if ans == len(set(n)):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

n = input()
ans = 0
for i in set(n):
  if n.count(i) % 2 == 0:
    ans += 1
    
if ans == len(set(n)):
  print("Yes")
else:
  print("No")
cnt = 0
def s(start, end):
    global cnt
    if(start==len(S)-1):
        return 
    numS = int(S[start:end+1])
    if(numS%2019==0 and numS!=0):
        cnt += 1
    if(end==len(S)-1):
        end = start+2
        s(start+1, end)
        return
    s(start, end+1)

if __name__ == '__main__':
    S = input()
    s(0, 1)
    print(cnt)

### FIXED CODE ###

S = list(map(int, list(input())))[::-1]
N = len(S)
CNT = [0]*2019
CNT[0] = 1
num = 0
d = 0
for i in range(N):
    num += S[i]*pow(10, d, 2019)
    num %= 2019
    CNT[num] += 1
    d += 1
ans = 0 
for cnt in CNT:
    ans += (cnt*(cnt - 1)) // 2
print(ans)
n = int(input())
h_list = list(map(int,input().split()))
ans_list =[]
ans = 0
for t in range(1,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if t == n-2:
      ans_list.append(ans)
  else:
    ans_list.append(ans)
    ans = 0
print(max(ans_list))

### FIXED CODE ###

n = int(input())
h_list = list(map(int,input().split()))
max = 0
ans = 0
for t in range(0,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if ans >= max:
      max = ans
  else:
    ans = 0
print(max)
import sys
n=int(input())
a=[[int(i) for i in l] for l in sys.stdin]
a.sort()
stack=a[0]
num=1
ans=0
for i in range(1,n):
  if a[i]==stack:
    num+=1
  else:
    if num%2==1:
      ans+=1
    stack=a[i]
    num=1
if num%2==1:
  ans+=1
print(ans)

### FIXED CODE ###

import sys
n=int(input())
a=[int(i) for i in sys.stdin]
a.sort()
stack=a[0]
num=1
ans=0
for i in range(1,n):
  if a[i]==stack:
    num+=1
  else:
    if num%2==1:
      ans+=1
    stack=a[i]
    num=1
if num%2==1:
  ans+=1
print(ans)
point = int(input())

if 400 <= point <=599 :
    print("8")
elif 600<= point <= 799 :
    print("7")
elif 800 <= point <= 999 :
    print("6")
elif 1000 <= point <= 1199 :
    print("5")
elif 1200 <= point <= 1399 :
    print("4")
elif 1400 <= point <= 1599 :
    print("3")
elif 1600 <= point <= 1799 :
    prin("2")
elif 1800 <= point <= 1999 :
    print("1")

### FIXED CODE ###

point = int(input())

if 400 <= point <=599 :
    print("8")
elif 600<= point <= 799 :
    print("7")
elif 800 <= point <= 999 :
    print("6")
elif 1000 <= point <= 1199 :
    print("5")
elif 1200 <= point <= 1399 :
    print("4")
elif 1400 <= point <= 1599 :
    print("3")
elif 1600 <= point <= 1799 :
    print("2")
elif 1800 <= point <= 1999 :
    print("1")
c = 0
while True:
    x == int(input())
    if x == 0:
         break;

   c += 1
   print('Case',str(c) + ':',x)

### FIXED CODE ###

c = 0
while True:
    x = int(input())
    if x == 0:
        break;

    c += 1
    print('Case', str(c) + ':',  x)
n = input()
i = 2
while True:
  if i%2==0 and i%n==0:
    print(i)
    break
  i +=1

### FIXED CODE ###

n = int(input())
if n%2==0:
  print(n)
else:
  print(2*n)
k = int(input())
if k%2==1:
  print((k//2)*(k//2+1))
else:
  print(k//2)**2


### FIXED CODE ###

K = int(input())
if K%2 == 0:
  print(int((K/2)**2))
else:
  print(int((K-1)*(K+1)/4))
house = [[[0 for i in range(10)]for j in range(3)]for k in range(4)]
n = int(input())
for i in range(n):
	b,f,r,v = map(int,input().split())
	house[b][f][r] += v

for i in range(4):
	for j in range(3):
		for k in range(10):
			print(' ',end='')
			if k != 9:
				print(house[i][j][k],end='')
			else:
				print(house[i][j][k])
	if i<3:
		print('####################')


### FIXED CODE ###

house = [[[0 for i in range(10)]for j in range(3)]for k in range(4)]
n = int(input())
for i in range(n):
	b,f,r,v = map(int,input().split())
	house[b-1][f-1][r-1] += v

for i in range(4):
	for j in range(3):
		for k in range(10):
			print(' ',end='')
			if k != 9:
				print(house[i][j][k],end='')
			else:
				print(house[i][j][k])
	if i<3:
		print('####################')
import math
a, b, x = map(int, input().split())

y = 2 * x / (a*a) - b
print(math.degrees(math.atan(a/(b-y))))

### FIXED CODE ###

import math
a, b, x = map(int, input().split())

if a * a * b == x:
    print(0)
# 台形の場合
elif a * a * b < 2 * x:
    y = 2 * x / (a*a) - b
    print(90 - math.degrees(math.atan(a/(b-y))))

else:
    y = 2 * x / a / b
    print(90 - math.degrees(math.atan(y/b)))
n = int(input())
H = list(map(int, input().split()))
cnt = 0

for i in range(n-1):
    if H[i] >= H[i+1]:
        cnt += 1
    else:
        cnt = 0
        continue
    ans = max(cnt, 0)

print(ans)


### FIXED CODE ###

n = int(input())
H = list(map(int, input().split()))
cnt = 0
ans = 0

for i in range(n-1):
    if H[i] >= H[i+1]:
        cnt += 1
        ans = max(cnt, ans)
    else:
        cnt = 0

print(ans)
a,b = int(input())
Z = a*b:
  print(Z)


### FIXED CODE ###

a,b =map(int,input().split())
if 1 <= a <=100 and 1 <= b <= 100:
     print(a*b)
from collections import deque
def map_all(es):
    return all([e == es[0] for e in es[1:]]) if es else False

if __name__ == '__main__':
    N = int(input())
    A = [deque(map(int, input().split())) for i in range(N)]
    member = list(range(N))
    today = []
    flag=False
    
    for d in range(N*(N-1)//2):
        for me in member:
            if len(A[me-1]) != 0:
                opp = A[me-1][0]
                if A[opp-1][0] == me:
                    today.append(me)


        for n in today:
            A[n-1].popleft()
            if len(A[n-1]) == 0:
                member.remove(n-1)
        today = []
        
        if len(member)==0: #map_all(A):
            flag=True
            break
    if flag:
        print(d+1)
    else:
        print(-1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

def dfs(v, graph):
    if visited[v]:
        if not calculated[v]: #visited and not calculated == loop
            return -1 
        return depth[v]
    visited[v] = True
    for e in graph[v]: # すべての辺をなめる
        res = dfs(e, graph) # 再帰
        if res == -1: 
            return -1 # ループを見つけたら-1を返す
        
        depth[v] = max(depth[v], res+1) #より深い経路を発見したか？
    calculated[v] = True 
    return depth[v]


if __name__ == '__main__':
    N = int(input())
    Ng = N*(N-1)//2
    graph = [[] for _ in range(Ng)]
    G_id = [[-1]*N for _ in range(N)]
    
    game_id = 0
    for i in range(N):
        row = list(map(int, input().split()))
        for d, r in enumerate(row):
            if G_id[i][r-1] == -1: #新しい試合の組み合わせ
                G_id[i][r-1] = game_id 
                G_id[r-1][i] = game_id
                
                if d != 0: # 行が更新されているかのチェック
                    graph[before].append(game_id)
                
                before = game_id # idの更新・一つ記録
                game_id += 1
            else: # 既存の組み合わせ
                if d != 0: # 行が更新されているかのチェック
                    graph[before].append(G_id[i][r-1])
                before = G_id[i][r-1] #現在の試合を記録
    
    depth = [1]*Ng # 頂点から出発したときの最長経路
    visited = [False]*Ng
    calculated = [False]*Ng
    flag = True
    ans = 1
    for i in range(Ng):
        res = dfs(i, graph)
        if res == -1:
            flag = False
        else:
            ans = max(ans, res)
    if flag:
        print(ans)
    else:
        print(-1)
import sys
import math
import itertools
import numpy
import sympy

rl = sys.stdin.readline
x = int(rl())
while True:
    if sympy.isprime(x):
        print(x)
        break
    x += 1



### FIXED CODE ###

import sys
import math
import itertools

rl = sys.stdin.readline
x = int(rl())
while True:
    if x == 2:
        print(2)
        break
    if x % 2:
      for i in range(3, x//2, 2):
        if x % i == 0:
            break
      else:
        print(x)
        break
    x += 1
N=int(input())
a=[]
for i in N:
  a.append(input())
print(len(collections.Counter(a)))

### FIXED CODE ###

import collections
N=int(input())
a=[]
for i in range(N):
  a.append(input())
print(len(collections.Counter(a)))
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
R = [i for i in range(N)]
def root(i):
  if R[i] == A[i]:
    return A[i]
  else:
    R[i] = root(R[i])
    return R[i]
def union(i, j):
  Ri = root(i)
  Rj = root(j)
  if A[Ri] <= A[Rj]:
    R[j] = i
  else:
    R[i] = j
for m in range(M):
  i, j = map(int, input().split())
  union(i, j)
for i in range(N):
  r = root(i)
F = sorted([A[i] for i in list(set(R))])
ans = 0
for a in A[1:]:
  ans += A[0] + a
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
A = [int(x) for x in input().split()]
R = [i for i in range(N)]
def root(R, i):
  if R[i] == i:
    return i
  else:
    R[i] = root(R, R[i])
    return R[i]
def union(i, j):
  ri = root(R, i)
  rj = root(R, j)
  if ri <= rj:
    R[rj] = ri
  else:
    R[ri] = rj
for m in range(M):
  i, j = map(int, input().split())
  union(i, j)
for i in range(N):
  R[i] = root(R, i)
if N < 2 * (N - M - 1):
  print('Impossible')
elif M == N - 1:
  print(0)
else:
  cnt= 0
  E = N - M - 2
  C = [0] * N
  F = sorted([[a, R[i]] for i, a in enumerate(A)])
  for a, r in F:
    if C[r] == 0:
      C[r] = a
      cnt += a
    elif E > 0:
      cnt += a
      E -= 1
  print(cnt)
#MLE注意！0や1のケースに注意

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    #from math import gcd

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    a = list(map(int, input().split()))
    res = 0
    l = [0]*(10**6)
    used = []
    for i in range(n):
        if 0<=i+1-a[i]<n:
            l[i+1-a[i]] += 1
            used.append(i+1-a[i])
    cnt = 0
    for i in range(n):
        if 0<=i+1-a[i]<n:
            l[used[cnt]] -= 1
            cnt += 1
        b = i+1+a[i]
        res += l[b]
    print(res)



if __name__ == '__main__':
    main()

### FIXED CODE ###

#MLE注意！0や1のケースに注意

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    #from math import gcd

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    a = list(map(int, input().split()))
    res = 0
    l = [0]*(10**6)
    used = []
    for i in range(n):
        if 0<=i+1-a[i]<n:
            l[i+1-a[i]] += 1
            used.append(i+1-a[i])
    cnt = 0
    for i in range(n):
        if 0<=i+1-a[i]<n:
            l[used[cnt]] -= 1
            cnt += 1
        if 0<=i+1+a[i]<10**6:
            b = i+1+a[i]
            res += l[b]
    print(res)



if __name__ == '__main__':
    main()
from functools import reduce
mod = 10**9+7
def mul(a,b):
    return a*b % mod
def cmb(n,r,mod):
    r = min(n-r,r)
    above = reduce(mul,range(n-r+1,n+1)) 
    below = reduce(mul,range(1,r+1)) 
    ans = above*pow(below,mod-2,mod) % mod
    if ans < 0:
        ans += mod
    return ans
n,a,b = map(int,input().split())
print(pow(2,n,mod)-cmb(n,a,mod)-cmb(n,b,mod)-1)

### FIXED CODE ###

def pow(a,b,c):
    ans = 1
    while b > 0:
        if b & 1:
            ans = ans*a % c
        a = a*a % c
        b = b >> 1
    return ans
def cmb(a,b,c):
    b = min(b,a-b)
    num = 1
    for i in range(b):
        num = num*(n-i) % c
    den = 1
    for i in range(b):
        den = den*(i+1) % c
    return num*pow(den,c-2,c) % c
mod = 10**9+7
n,a,b = map(int,input().split())
ans  = (pow(2,n,mod)-cmb(n,a,mod)-cmb(n,b,mod)-1) % mod
if ans < 0:
    ans = ans + mod
print(ans)
n=int(input())
 
i=1
l=0
for i range (9):
    if n/i==n//i and n//i<10:
      l=l+1
print("Yes" if l>0 else "No")

### FIXED CODE ###

n=int(input())

i=1
l=0
while i<10:
    if n/i==n//i and n//i<10:
        l=l+1
    i=i+1
print("Yes" if l>0 else "No")
while True:
	a,b = map(int,raw_input().split())
	print len(srt(a+b))

### FIXED CODE ###

while True:
	try:
		a,b = map(int,raw_input().split())
		print len(str(a+b))
	except EOFError:
		break
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

ans = sum(B)

now = 0
for i in A:
  pre = now
  now = i
  if now == (pre+1):
    ans += C[pre-1]
print(ans)

### FIXED CODE ###

N = int(input())

anc = N**3
print(anc)