Harryxun/stf_run huggingface dataset:
import itertools
import math

n = input()
p = [map(int, input().split())]
q = [map(int, input().split())]
p_no, q_no = 0, 0

per = [c+1 for c in range(n)]
per_list = list(itertools.permutations(per))

for i in range(math.factorial(n)):
    if p == per_list[i]: p_no = i
    if q == per_list[i]: q_no = i

print(abs(p_no - q_no))

### FIXED CODE ###

import itertools
import math

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
p_no, q_no = 0, 0

per = [c+1 for c in range(n)]
per_list = list(itertools.permutations(per))

for i in range(math.factorial(n)):
    if p == per_list[i]:
        p_no = i
    if q == per_list[i]:
        q_no = i

print(abs(p_no - q_no))
d = {};
d["A"] = 0;
d["B"] = 0;
d["AB"] = 0;
d["O"] = 0;

while True:
 b = raw_input().strip().split(",")[1]
 d[b] += 1;

print d["A"]
print d["B"]
print d["AB"]
print d["O"]

### FIXED CODE ###

d = {};
d["A"] = 0;
d["B"] = 0;
d["AB"] = 0;
d["O"] = 0;

while True:
 try:
  b = raw_input().strip().split(",")[1]
  d[b] += 1;
 except:
  break;

print d["A"]
print d["B"]
print d["AB"]
print d["O"]
N = int(input())
A,B = [int(input()) for i in range(2)]
  
if N==1:
  print('Hello World')

elif N==2:
  print(A+B)

### FIXED CODE ###

n = int(input())
 
if n == 1:
	print("Hello World")
else:
	a = int(input())
	b = int(input())
	print(a+b)
from collections import deque
def factorials(M):#M!までのリストｘと其の逆元のリストyを返すmod INF
    INF=int(1e9+7)
    fac=[0]*(M+1)
    finv=[0]*(M+1)
    inv=[0]*(M+1)
    fac[0]=fac[1]=1
    finv[0]=finv[1]=1
    inv[1]=1
    for i in range(2,M+1):
        fac[i]=(fac[i-1]*i)%INF
        inv[i]=INF-(inv[INF%i]*(INF//i))%INF
        finv[i]=finv[i-1]*inv[i]%INF
    return fac,finv

N,K=map(int,input().split())
fac,finv=factorials(K)
def nCr(n,r):
    INF=int(1e9+7)
    if n<r or r<0 or n<0 :
        return 0
    return fac[n]*(finv[r]*finv[n-r]%INF)%INF
A=[0]*N
G=[[] for i in range(N)]
MOD=10**9+7
for i in range(N-1):
    a,b=map(int,input().split())
    a,b=a-1,b-1
    A[a]+=1
    A[b]+=1
    G[a].append(b)
    G[b].append(a)
ans=K
can=K
grand=0
gpare=-1
stack=deque([[0,gpare]])
while(stack):
    pare,gpare=stack.pop()
    childs=G[pare]
    ans*=nCr(K-1-grand,len(childs)-grand)*fac[len(childs)-grand]
    ans%=MOD
    grand=1
    for i in childs:
        if i==gpare:
            continue
        if A[i]-1==0:
            continue
        stack.append([i,pare])
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100100)
from collections import deque
def factorials(M):#M!までのリストｘと其の逆元のリストyを返すmod INF
    INF=int(1e9+7)
    fac=[0]*(M+1)
    finv=[0]*(M+1)
    inv=[0]*(M+1)
    fac[0]=fac[1]=1
    finv[0]=finv[1]=1
    inv[1]=1
    for i in range(2,M+1):
        fac[i]=(fac[i-1]*i)%INF
        inv[i]=INF-(inv[INF%i]*(INF//i))%INF
        finv[i]=finv[i-1]*inv[i]%INF
    return fac,finv

N,K=map(int,input().split())
fac,finv=factorials(max(N,K))
def nCr(n,r):
    INF=int(1e9+7)
    if n<r or r<0 or n<0 :
        return 0
    return fac[n]*(finv[r]*finv[n-r]%INF)%INF
A=[0]*N
G=[[] for i in range(N)]
MOD=10**9+7
for i in range(N-1):
    a,b=map(int,input().split())
    a,b=a-1,b-1
    A[a]+=1
    A[b]+=1
    G[a].append(b)
    G[b].append(a)
ans=K
can=K
grand=0
gpare=-1
stack=deque([[0,gpare]])
while(stack):
    pare,gpare=stack.pop()
    childs=G[pare]
    ans*=nCr(K-1-grand,len(childs)-grand)*fac[len(childs)-grand]
    ans%=MOD
    grand=1
    for i in childs:
        if i==gpare:
            continue
        if A[i]-1==0:
            continue
        stack.append([i,pare])
print(ans)
h,n=map(int,input().split())
a=list(map(int,input().split())
if sum(a)>=h:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

h,n=map(int,input().split())
a=list(map(int,input().split()))
if sum(a)>=h:
  print("Yes")
else:
  print("No")
N,W=map(int,input().split())
lst=[-1]*(W+1)
lst[0]=0

for i in range(N):
    w,v=map(int,input().split())
    for j in range(W-w,-1,-1):
        if lst[j]!=-1:
            Value=lst[j]+v
            if Value>lst[j+w]:
                lst[j+w]=Value

print(max(lst))

### FIXED CODE ###

N,W=map(int,input().split())
w1,v=map(int,input().split())
if w1>W:
    print(0)
    exit()
lst=[[-1]*(3*N-2) for _ in range(N)]
lst[0][0]=v
for i in range(N-1):
    w,v=map(int,input().split())
    for j in range(N-1,-1,-1):
        for k in range(3*N-2):
            if lst[j][k]!=-1:
                if (j+1)*w1+k+w<=W:
                    lst[j+1][k+w-w1]=max(lst[j][k]+v,lst[j+1][k+w-w1])
    lst[0][w-w1]=max(v,lst[0][w-w1])

lst=[i for j in lst for i in j]
print(max(lst))
a,b,t=map(int,input().split())
cnt=0
for i in range(1,t+0.5,a):
    cnt+=b
print(cnt)

### FIXED CODE ###

a,b,t=map(int,input().split())
cnt=0
for i in range(a,t+1,a):
    cnt+=b
print(cnt)
n=A*3
pe=n+P
apple=pe//2


### FIXED CODE ###

A, P = map(int, input().split())
P += A * 3
print(int(P / 2))
from fractions import gcd
N,A,B,K=map(int,input().split())
mod=998244353

Factorial=[1]*(N+1)
for i in range(1,N+1):
  Factorial[i]=Factorial[i-1]*(i)%mod
def power(x,y):
  if y==0:
    return 1
  elif y==1:
    return x%mod
  elif y%2==0:
    return power(x,y//2)**2%mod
  else:
    return (power(x,y//2)**2)*x%mod

inverseFactorial=[1]*(N+1)
inverseFactorial[N]=power(Factorial[N],mod-2)
for i in range(0,N)[::-1]:
  inverseFactorial[i]=(inverseFactorial[i+1]*(i+1))%mod
  
def f(i,j):
  if i>j:
    i,j=j,i
  res=0
  if j<=N:
    for k in range(max(0,i+j-N),i+1):
      res+=Factorial[N]*inverseFactorial[i-k]*inverseFactorial[j-k]*inverseFactorial[k]*inverseFactorial[N-i-j+k]
  return res%mod
      
ans=0
g=gcd(A,B)
if K%g==0:
  A,B,K=A//g,B//g,K//g
else:
  print(0)
  exit()
for i in range(K//A+1):
  if (K-A*i)%B==0:
    x0=i
    y0=(K-A*i)//B
    break
m=0
while y0-A*m>=0:
  ans+=f(x0+B*m,y0-A*m)
  ans%=mod
  m+=1
    
print(ans%mod-1)

  

### FIXED CODE ###

N=int(input())
ans=float("inf")
for i in range(1,N):
  A,B=str(i),str(N-i)
  S=0
  for a in range(len(A)):
    S+=int(A[a])
  for b in range(len(B)):
    S+=int(B[b])
  ans=min(ans,S)
print(ans)
H, W = map(int, input().split())
s_a = []
for _ in range(W):
    s = list(input())
    s_a.append(s)

check_list = [(0,1),(0,-1),(1,0),(-1,0)]

def check(i,j):
    for x,y in check_list:
        try: 
            if s_a[i+x][j+y] == '#':
                return True
        except:
            continue
    return False

ans = 'Yes'
for i in range(H):
    for j in range(W):
        if s_a[i][j] == '#':
            if check(i,j):
                continue
            else:
                ans = 'No'
print(ans) 

### FIXED CODE ###

H, W = map(int, input().split())
s_a = []
for _ in range(H):
    s = list(input())
    s_a.append(s)

check_list = [(0,1),(0,-1),(1,0),(-1,0)]

def check(i,j):
    for x,y in check_list:
        try: 
            if s_a[i+x][j+y] == '#':
                return True
        except:
            continue
    return False

ans = 'Yes'
for i in range(H):
    for j in range(W):
        if s_a[i][j] == '#':
            if check(i,j):
                continue
            else:
                ans = 'No'
                break
print(ans)
from collections import deque

n = int(input())
a = deque(map(int, input().split()))
a.appendleft(0)
a.append(0)
a = list(a)
kaisa = deque()
ans = list()

for i in range(len(a)):
    if i == 0:
        continue
    diff = a[i] - a[i - 1]
    kaisa.append(diff)


for i in range(n):
    ans = kaisa.copy()
    new_num = kaisa[i] + kaisa[i + 1]
    ans.remove(kaisa[i])
    ans.remove(kaisa[i + 1])
    ans.insert(i, new_num)
    print(sum([abs(n) for n in ans]))

### FIXED CODE ###

from collections import deque

n = int(input())
a = deque(map(int, input().split()))
a.appendleft(0)
a.append(0)

sum = sum([abs(a[i + 1] - a[i]) for i in range(len(a) - 1)])
ans = 0

for i in range(n):
    ans = sum
    ans = ans - abs(a[i + 1] - a[i]) - abs(a[i + 2] - a[i + 1]) + abs(a[i + 2] - a[i])
    print(ans)
import numpy as np

N = int(input())
X = [0] * N
L = [0] * N

cnt = N

for i in range(N):
    X[i], L[i] = map(int, input().split())
    
index_sort = np.argsort(X)
X_sort = sorted(X)

L_sort = [0] * N

for i in range(N):
  L_sort[i] = L[ index_sort[i] ]

if(N >= 3):
  for i in range(1, N - 1):
    if( abs(X_sort[i] - X_sort[i-1]) <= L_sort[i] or
       abs(X_sort[i+1] - X_sort[i]) <= L_sort[i+1]):
      X_sort[i]=X_sort[i-1]
      L_sort[i]=L_sort[i-1]
      cnt -= 1
      
if( X_sort[1] - X_sort[0] < L_sort[0] or
    X_sort[1] - X_sort[0] < L_sort[1]):
  if( X_sort[1] != X_sort[0] ):
    cnt -= 1
print(cnt)

### FIXED CODE ###

# 参考
# https://atcoder.jp/contests/keyence2020/submissions/9575705
#------------------------------------------

n = int(input())
robots = []

for i in range(n):
    x, l = map(int, input().split())
    robots.append([x + l, x - l])
    
#robotsという配列には
#・[0]に右側の手で届く範囲
#・[1]に左側の手で届く範囲
#が格納されている。
    
robots.sort()

r = - 10 ** 9 - 1
cnt = 0
for i in range(n):
    if r <= robots[i][1]:#この式で、左側に腕を伸ばした時にぶつからないことを指している
        cnt += 1
        r = robots[i][0]#最小値には右側に腕を伸ばした場合を代入
print(cnt)
N,X,T=map(int,input().split())
a=(N/x+1)
print(a*T)

### FIXED CODE ###

N,X,T=map(int,input().split())
if N%X ==0:
    print(N*T//X)
else:
    print(((N//X)+1)*T)
N, M = map(int, input().split())
 
G = [[] for _ in range(N + 1)]
for i in range(M):
    x, y = map(int, input().split())
    G[x] += [y]
# print(G)
 
dp = [-1] * (N + 1)
 
 
def func(n):
    if dp[n] != -1:
        return dp[n]
    cnt = 0
	# 先にノードが存在する場合
	# ノードが存在しない場合は、cnt=0のままforをすっ飛ばす
    for m in G[n]:
        cnt = max(cnt, func(m) + 1)
    dp[n] = cnt
    return cnt
 
 
for i in range(1, N + 1):
    func(i)
 # print(dp)
print(max(dp))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
 
 
N, M = map(int, input().split())
 
G = [[] for _ in range(N + 1)]
for i in range(M):
    x, y = map(int, input().split())
    G[x] += [y]
# print(G)
 
dp = [-1] * (N + 1)
 
 
def func(n):
    if dp[n] != -1:
        return dp[n]
    cnt = 0
	# 先にノードが存在する場合
	# ノードが存在しない場合は、cnt=0のままforをすっ飛ばす
    for m in G[n]:
        cnt = max(cnt, func(m) + 1)
    dp[n] = cnt
    return cnt
 
 
for i in range(1, N + 1):
    func(i)
 
# print(dp)
print(max(dp))
[n, m] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
st = [[] for _ in range(n)]
for i in range(m):
    [a, b] = [int(i) for i in input().split()]
    st[a-1].append(b-1)
    st[b-1].append(a-1)
cnt = 0
for i, height in enumerate(h):
    line = []
    hoge = set(st[i])
    for huga in hoge:
        line.append(h[huga])
    if type(huga) is int:
        if height > huga:
            cnt += 1
    elif height > max(huga):
        cnt += 1
print(cnt)

### FIXED CODE ###

[n, m] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
st = [set([]) for _ in range(n)]
for i in range(m):
    [a, b] = [int(i) for i in input().split()]
    st[a-1].add(b-1)
    st[b-1].add(a-1)
cnt = 0
for i, height in enumerate(h):
    line = []
    for huga in st[i]:
        line.append(h[huga])
    if len(line) == 0 or height > max(line):
        cnt += 1
print(cnt)
L,R = map(int,input().split())
if R-L >= 2019:
    print(0)
else:
    ans = []
    for i in range(L,R):
        ans.append(i*j*2019)
    print(min(ans))


### FIXED CODE ###

l,r = map(int,input().split())
m = r-l

if m >= 2019:
  print(0)
else:
  cnt = []
  for i in range(l,r):
    for j in range(l+1,r+1):
      cnt.append(i*j%2019)
  print(min(cnt))
# 09-Computation-Min_Max_and_Sum.py

# ????°????????????§??????????¨????
# n ????????´??° ai(i=1,2,...n)?????\?????????????????????????°????????????§??????????¨????????±???????????????°????????????????????????????????????

# Input
# ??????????????´??°?????° n ???????????????????????????????????? n ????????´??° ai ????????????????????§?????????????????????
# Output
# ????°????????????§??????????¨????????????????????????§????????????????????????????????????

# Constraints
# 0<n???10000
# ???1000000???ai???1000000
# Sample Input
# 5
# 10 1 5 4 17
# Sample Output
# 1 17 37

num = int(input())
num_min = 100001
num_max = -100001
num_sum = 0

# a = []
# a = [ *map(int,input().split() ) ]


for i in range(num):
	if a[i]<num_min:
		num_min = a[i]

	if a[i]>num_max:
		num_max = a[i]

	num_sum+=a[i]

print("{0} {1} {2}".format(num_min,num_max,num_sum) );

### FIXED CODE ###

# 09-Computation-Min_Max_and_Sum.py

# ????°????????????§??????????¨????
# n ????????´??° ai(i=1,2,...n)?????\?????????????????????????°????????????§??????????¨????????±???????????????°????????????????????????????????????

# Input
# ??????????????´??°?????° n ???????????????????????????????????? n ????????´??° ai ????????????????????§?????????????????????
# Output
# ????°????????????§??????????¨????????????????????????§????????????????????????????????????

# Constraints
# 0<n???10000
# ???1000000???ai???1000000
# Sample Input
# 5
# 10 1 5 4 17
# Sample Output
# 1 17 37

num_min = 1000001
num_max = -1000001
num_sum = 0
num = int(input())

# a = []
# a = [ *map(int,input().split() ) ]
a = input().split()

for i in range(num):
	a[i]=int(a[i])
	if a[i]<num_min:
		num_min = a[i]

	if a[i]>num_max:
		num_max = a[i]

	num_sum+=a[i]

print("{0} {1} {2}".format(num_min,num_max,num_sum) );
num = input()
num1 = int(num[0] + num[1])
num2 = int(num[2] + num[3])

if(num1 < 13) and (num1 > 0):
    if(num2 < 13) and (num2 > 0):
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if(num2 < 13) and (num2 > 0):
        print("YYMM")
    else:
        print("NA")


### FIXED CODE ###

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

smalls = s[k-1].lower()

print(s[:k-1] + smalls + s[k:])
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a = a.sort()[:3]
b = []
for i in [0,1,2]:
  for j in [0,1,2]:
    if i != j:
      b.append(int(str(a[i] + a[j])))
b.sort()
print(b[2])



### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
a = a[:4]
b = []
for i in [0,1,2,3]:
  for j in [0,1,2,3]:
    if i != j:
      b.append(int(str(a[i]) + str(a[j])))
b.sort()
print(b[2])
h,w,a,b=map(int,input().split())

tmp=[0]*w
lista=[]
for i in range(h):
    lista.append([0]*w)
    
if a>w/2 or b>h/2:
    print("No")

elif h==1:
    for i in range(w-a):
        lista[0][a+i]=1
elif w==1:
    for i in range(h-b):
                lista[b+i][0]=1
else:  
    for i in range(w-a):
        lista[0][a+i]=1
    print(lista)
    if b!=0:    
        for i in range(a):
            for j in range(h-b):
                lista[b+j][i]=1
        print(lista)  
        for i in range(b):
            for i in range(w-a):
                lista[i][a+j]=1


print(lista)

### FIXED CODE ###

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

lista=[]

for i in range(h):
    lista.append([0]*w)

if (a>w/2)|(b>h/2):
    print("No")

else:
    if h==1:
        for i in range(w-a):
            lista[0][a+i]=1
    elif w==1:
        for i in range(h-b):
            lista[b+i][0]=1

    elif (a==0)&(b==0):
        lista=lista

    else:  
        for i in range(w-a):
            lista[0][a+i]=1
        
           
        if a==0:    
            for i in range(w):
                for j in range(b):
                    lista[j][i]=1 
        elif b==0:    
            for i in range(h):
                for j in range(w-a):
                    lista[i][j+a]=1                         
        else:    
            for i in range(a):
                for j in range(h-b):
                    lista[b+j][i]=1 
            for i in range(b):
                for j in range(w-a):
                    lista[i][a+j]=1


 

    for i in range(h):
        row = ""
        for j in range(w):
            row += str(lista[i][j])
        print(row)
raw_input()
for i in raw_input().split().reverse():
    print i,

### FIXED CODE ###

raw_input()
l = raw_input().split()
l.reverse()
for i in l:
    print i,
s,t = input().split()
a, b = map(int, input().split())
u = input()
if s == u:
  a -= 1
 else:
  b -= 1
 print(a,b)

### FIXED CODE ###

s,t = input().split()
a, b = map(int, input().split())
u = input()
if s == u:
  a -= 1
else:
  b -= 1
print(a,b)
import unittest
import math


def solution(n, a):
    gcd_left = [0]
    gcd_right = [0]
    for i in range(n):
        gcd_left.append(math.gcd(gcd_left[i], a[i]))
        # 順に(0とa[-1]), (a[-1]とa[-2]),...の比較
        # 要は右端から順にgcdを求めている
        gcd_right.append(math.gcd(gcd_right[i], a[-(i + 1)]))

    gcd_right = gcd_right[::-1]  # gcd_right[i]がi番目以降のgcdとなるように反転

    ans = []
    for i in range(n):
        ans.append(math.gcd(gcd_left[i], gcd_right[i + 1]))


    return max(ans)


class MyTestCase(unittest.TestCase):
    def test1(self):
        self.assertEqual(solution(3, [7, 6, 8]), 2)

    def test2(self):
        self.assertEqual(solution(3, [12, 15, 18]), 6)

    def test3(self):
        self.assertEqual(solution(2, [1000000000, 1000000000]), 1000000000)


def main():
    n = int(input())
    a = list(map(int, input().split()))
    print(solution(n, a))


if __name__ == '__main__':
  
    main()
    unittest.main()

### FIXED CODE ###

import unittest
import fractions


def solution(n, a):
    gcd_left = [0]
    gcd_right = [0]
    for i in range(n):
        gcd_left.append(fractions.gcd(gcd_left[i], a[i]))
        # 順に(0とa[-1]), (a[-1]とa[-2]),...の比較
        # 要は右端から順にgcdを求めている
        gcd_right.append(fractions.gcd(gcd_right[i], a[-(i + 1)]))

    gcd_right = gcd_right[::-1]  # gcd_right[i]がi番目以降のgcdとなるように反転

    ans = []
    for i in range(n):
        ans.append(fractions.gcd(gcd_left[i], gcd_right[i + 1]))


    return max(ans)


class MyTestCase(unittest.TestCase):
    def test1(self):
        self.assertEqual(solution(3, [7, 6, 8]), 2)

    def test2(self):
        self.assertEqual(solution(3, [12, 15, 18]), 6)

    def test3(self):
        self.assertEqual(solution(2, [1000000000, 1000000000]), 1000000000)




if __name__ == '__main__':

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

    unittest.main()
a, b = map(int, input())
print(a*b)

### FIXED CODE ###

a, b = input().split()

print(int(a) * int(b))
s1, s2, s3 = map(int,input().split())
list = [s1,s2,s3]
a = list.count(1)
print(a)

### FIXED CODE ###

print(input().count("1"))
import bisect
import sys
from itertools import accumulate
input = sys.stdin.readline
def hsnum(ls,x,n):
    num = 0
    for i in range(n):
        y = x-ls[i]
        num += n-bisect.bisect_left(ls,y)
    return num
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
suma = [0]+list(accumulate(a))
lx = 0
rx = 2*10**5+2
error = 0
while lx < rx:
    mx = (lx+rx)//2
    if hsnum(a,mx,n) < m:
        rx = mx
    elif hsnum(a,mx,n) > m:
        if hsnum(a,mx+1,n) < m:
            error = hsnum(a,mx,n)-m
            lx = mx
            break
        lx = mx + 1
    else:
        lx = mx
        break
ans = 0
for i in range(n):
    rema = lx - a[i]
    j = bisect.bisect_left(a,rema)
    ans += (n-j)*a[i]+suma[n]-suma[j]
print(ans-error*lx)

### FIXED CODE ###

s,t=input().split()
print(t+s)
n=int(input())
x=list(map(int,input().split()))
imax=int(max(x))
imin=int(min(x))
lis=[]
re=0
for k in range(imin,imax+1):
  for i in x:
    re=re+(x[i]-k)**2
  lis.append(re)
  re=0
print(min(lis))

### FIXED CODE ###

n=int(input())
x=list(map(int,input().split()))
imax=int(max(x))
imin=int(min(x))
lis=[]
re=0
for k in range(imin,imax+1):
  for i in x:
    re=re+(i-k)**2
  lis.append(re)
  re=0
print(min(lis))
input_str = input().split(' ')
W = int(input_str[0])
H = int(input_str[1])
x = int(input_str[2])
y = int(input_str[3])
r = int(input_str[4])

print('Yes' if x-r >= 0 and x+r =< W and y-r >= 0 and y+r <= H else 'No')

### FIXED CODE ###

input_str = input().split(' ')
W = int(input_str[0])
H = int(input_str[1])
x = int(input_str[2])
y = int(input_str[3])
r = int(input_str[4])

print('Yes' if x-r >= 0 and x+r <= W and y-r >= 0 and y+r <= H else 'No')
K = int(input())


if K%2 = 0:
	print(K/2)*(K/2)
else:
	print(K*K-1)/4


### FIXED CODE ###

k = int(input())

if k % 2 == 0:
    print((k//2)**2)
else:
    print((k//2)*((k//2)+1))
N = int(input())
A = [int(input()) for i in range(N)]
B=0
for i in A:
    #if A.count(i) >= 1:
    if A.count(i)%2 == 0: 
        A.remove(i)
    else:
        B += 1
print(B)

### FIXED CODE ###

N = input()
print('Yes' if '9' in N else 'No')
#n = int(input())
n,m,k = [int(z) for z in input().split()]
a = [int(z) for z in input().split()]
b = [int(z) for z in input().split()]
time = 0
i = j = 0
while (time<=k and i<n and j<m):
      #print(i,j,time)
      if (a[i]<b[j]):
            if (time+a[i]<=k):
                  time += a[i]
                  i+=1
            else:
                  break
      else:
            if (time+b[j]<=k):
                  time += b[j]
                  j+=1
            else:
                  break
while (i<n and time<=k):
      if (time+a[i]<=k):
                  time += a[i]
                  i+=1
      else:
            break
while (j<n and time<=k):
      if (time+b[j]<=k):
                  time += b[j]
                  j+=1
      else:
            break
print(i+j)


### FIXED CODE ###

import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    N, M, K = map(int, readline().split())
    A = list(map(int, readline().split()))
    B = list(map(int, readline().split()))


    nowtime = 0

    Asum = [0]
    Bsum = [0]
    tmp = 0
    for a in A:
        tmp += a
        Asum.append(tmp)
    tmp = 0
    for b in B:
        tmp += b
        Bsum.append(tmp)

    maxbooks = 0
    before = M
    bcount = M
    for acount in range(N+1):
        if Asum[acount] > K:
            continue
        while K < Asum[acount] + Bsum[bcount]:
            bcount -= 1
        maxbooks = max(maxbooks, acount+bcount)

    print(maxbooks)

if __name__ == '__main__':
    solve()
mod=int(1e9+7)
n,k=map(int,input().split())
g=[[] for i in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  a-=1; b-=1
  g[a].append(b); g[b].append(a);
 
dp=[-1 for x in range(n)]
def f(v,p):
  if dp[v]!=-1:
    return dp[v]
  dp[v]=0

  s=0
  if p>=0:
    for i in g[p]:
      s += 1 if dp[i]!=-1 else 0
 
  dp[v]=max(k-s,0)
  for i in g[v]:
    if i!=p:
      dp[v]=(dp[v]*f(i,v))%mod
  return dp[v]
 
print(f(0,-1))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

mod=int(1e9+7)
n,k=map(int,input().split())
g=[[] for i in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  a-=1; b-=1
  g[a].append(b); g[b].append(a);
 
dp=[-1 for x in range(n)]
def f(v,p):
  if dp[v]!=-1:
    return dp[v]

  dp[v]=1
  j=1+int(v!=0)
  for i in g[v]:
    if i!=p:
      dp[v]=(dp[v]*f(i,v)*max(k-j,0))%mod
      j+=1
  return dp[v]
 
print(f(0,-1)*k%mod)
N = int(input())

num_list = list(map(int, input().split()))

hats = [0, 0, 0]


ans = 1

for i in range(N):
    same_color = num_list[i]
    cand_num = hats.count(same_color)
    ans *= cand_num
    ans = ans % 1000000007
    hats[hats.index(same_color)] += 1

print(ans)


### FIXED CODE ###

N = int(input())

num_list = list(map(int, input().split()))

hats = [0, 0, 0]


ans = 1

for i in range(N):
    same_color = num_list[i]
    if same_color not in hats:
        print(0)
        break
    cand_num = hats.count(same_color)
    ans *= cand_num
    ans = ans % 1000000007
    hats[hats.index(same_color)] += 1
else:
    print(ans)
while True:
	n=int(input())
	if n:
		a=[list(map(int,input().split())) for _ in range(n)]
		b={}
		for i in range(n):
			if a[i][0] in b:
				b[a[i][0]]+=a[i][1]*a[i][2]
			else:
				b[a[i][0]]=a[i][1]*a[i][2]
		for k in b.keys():
			if b[k]>=1000000:
				print(k)
		if max(k.values())<1000000:
			print("NA")
	else:
		break

### FIXED CODE ###

while True:
	n=int(input())
	if n==0: break
	l=[]
	d={}
	for _ in range(n):
		a,b,c=list(map(int,input().split()))
		if a in d:
			d[a]+=b*c
		else:
			d[a]=b*c
			l.append(a)
	if max(d.values())<1000000:
		print("NA")
	else:
		for k in l:
			if d[k]>=1000000:
				print(k)