Harryxun/stf_run huggingface dataset:
import sys
import re
import numpy as np
from itertools import combinations
 
 
def answer(l):
    results = []
    for i, j in combinations(l, 2):
        v_a = np.array(i)
        v_b = np.array(j)
        results.append(np.linalg.norm(v_a - v_b))
    return sum(float.is_integer(i) for i in results)
 
rows = re.split('\n', sys.stdin.read())
args = [list(map(int, row.split(' '))) for row in rows][1:]
print(answer(args))

### FIXED CODE ###

n, d = map(int, input().split())
coodinates = [[int(x) for x in input().split()] for _ in range(n)]
result = 0
for left in range(n-1):
    for right in range(left+1,n):
        dist = 0
        for i in range(d):
            dist += (coodinates[left][i] - coodinates[right][i])**2
        dist = dist ** 0.5
        result += 1 if dist.is_integer() else 0
print(result)
sal
x1, y1, x2, y2 = map(int, input().split())
x3 = x2 + y1 - y2
y3 = y2 + x2 - x1
x4 = x3 + y2 - y3
y4 = y3 + x3 - x2
print(x3, y3, x4, y4)


### FIXED CODE ###

x1,y1,x2,y2= map(int,input().split())
a=x2-x1
b=y2-y1

x3=x2-b
y3=y2+a

x4=x3-a
y4=y3-b

print(x3,y3,x4,y4)
a, b = map(int, input().split())
x = (a + b)/2
print(math.ceil(x))

### FIXED CODE ###

import math
a, b = map(int,input().split())
x = (a + b)/2
print(math.ceil(x))
n = int(input())
a = list(map(int, input().split()))
money = 1000
nums = []
nums.append(a[0])
for i in range(1, n):
    if a[i] != a[i-1]:
        nums.append(a[i])
    else:
        continue
val = nums[0]
maxs = []
for j in range(1, len(nums)):
    if nums[j] > val:
        maxs.append(j)
    else:
        pass
    val = nums[j]
pos = 0
for idx in maxs:
    minVal = min(nums[pos:idx])
    stocks = money // minVal
    money = money - minVal * stocks + nums[idx] * stocks
    pos = idx + 1
print(money)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
nums = []
nums.append(a[0])
for i in range(1, n):
    if a[i] != a[i-1]:
        nums.append(a[i])
    else:
        continue
val = nums[0]
maxs = []
for j in range(1, len(nums)):
    if nums[j] > val:
        maxs.append(j)
    else:
        pass
    val = nums[j]
pos = 0
money = 1000
for idx in maxs:
    minVal = min(nums[pos:idx])
    stocks = money // minVal
    money = money - minVal * stocks + nums[idx] * stocks
    pos = idx
print(money)
n = input()
kakeru = map(int, input().split())
kakekake = kakeru[0]
    if n > 2:
        for i in range(n-2):
            kakekake = kakekake * kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

### FIXED CODE ###

n = int(input())
b = 1
a = list(map(int,input().split()))
if 0 in a:
    print(0)
else:
    for i in range(n):
        b *= a[i]
        if b > 10**18:
            print(-1)
            break
    if b <=10**18:
        print(b)
from collections import Counter
n = int(input())
ns = list(map(int, input().split()))
rslt = 0
a = 10 ** 9 + 7
cnt = Counter(ns)
if n % 2 == 0:
    for i in range(1, n, 2):
        if cnt[i] != 2:
            print(0)
            exit()
    rslt = pow(2, n // 2, a)
else:
    for i in range(2, n, 2):
        if cnt[i] != 2:
            print(0)
            exit()
    if c[0] == 1:
        rslt = pow(2, n // 2, a)
print(rslt)

### FIXED CODE ###

from collections import Counter
n = int(input())
ns = list(map(int, input().split()))
rslt = 0
a = 10 ** 9 + 7
cnt = Counter(ns)
if n % 2 == 0:
    for i in range(1, n, 2):
        if cnt[i] != 2:
            print(0)
            exit()
    rslt = pow(2, n // 2, a)
else:
    for i in range(2, n, 2):
        if cnt[i] != 2:
            print(0)
            exit()
    if cnt[0] == 1:
        rslt = pow(2, n // 2, a)
print(rslt)
print("{}:{}:{}".format(input()/60, input()/3600, input()%3600))

### FIXED CODE ###

i = int(input())
print("{}:{}:{}".format(int(i/(60*60)), int((i%(60*60))/(60)), i%60))
N = int(input())
A = list(map(int, input().split()))

dp_g = A[1]
dp_k = A[0]
dp = [0, max(dp_g, dp_k), max(dp_g, dp_k, A[2])]

for i in range(3, N):
    if i % 2 == 1:
        dp_g = max(dp_k, dp_g) + A[i]
        dp_k += A[i - 1]
        dp.append(max(dp_g, dp_k))
    elif i % 2 == 0:
        dp.append(max(dp[i - 1], dp[i - 2] + A[i]))

print(dp[N - 1])

### FIXED CODE ###

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

dp_g = A[1]
dp_k = A[0]
dp = [0, max(dp_g, dp_k)]

for i in range(2, N):
    if i % 2 == 1:
        dp_g = max(dp_k, dp_g) + A[i]
        dp_k += A[i - 1]
        dp.append(max(dp_g, dp_k))
    elif i % 2 == 0:
        dp.append(max(dp[i - 1], dp[i - 2] + A[i]))

print(dp[N - 1])
s=input()
t="CODEFESTIVAL2016"
ret=0
for i range(s.len()):
  if s[i] != t[i]:
    ret+=1
print(ret)

### FIXED CODE ###

s=input()
t="CODEFESTIVAL2016"
ret=0
for i in range(len(s)):
  if s[i] != t[i]:
    ret+=1
print(ret)
from collections import Counter

class Bit:
  def __init__(self, n):
    self.size = n
    self.tree = [0] * (n + 1)
  
  def sum(self, i):
    s = 0
    while i > 0:
      s += self.tree[i]
      i -= i & -i
    return s
  
  def add(self, i, x):
    while i <= self.size:
      self.tree[i] += x
      i += i & -i

n,k = map(int, input().split())
aaa = list(map(int, input().split()))
MOD = 10**9 + 7
bit = Bit(2001)
single = 0
for a in reversed(aaa):
  single += bit.sum(a)
  bit.add(a + 1, 1)
ans = single * k % MOD
coef = k * (k - 1) // 2 % MOD
cnt = Counter(aaa)
before = 0
for a,c in sorted(cnt.items()):
  ans = (ans + c * before * conf) % MOD
  before += c
print(ans)





### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()*2))
base1 = 0
base2 = 0
for i in range(N):
  count1=0
  count2=0
  for j in range(i+1,i+N+1):
    if A[i] > A[j]:
      if j < N:
        count1+=1
      else:
        count2+=1
  base1+=count1
  base2+=count2

ans = (base1*K*(K+1) + base2*K*(K-1))//2
div = 10**9 + 7
print(ans%div)
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
# from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

s=input()
x,y=map(int,input().split())
tate,yoko=[],[]
kaisi=0
tmp=0
flag=1
for i in range(len(s)):
    if s[i]=="F":
        tmp+=1
    elif s[i]=="T":
        if kaisi==0:
            kaisi=1
            x-=tmp
        elif flag==0:
            flag=1
            yoko.append(tmp)
        else:
            flag=0
            tate.append(tmp)
        tmp=0

if kaisi==0:
    kaisi=1
    x-=tmp
elif flag==0:
    flag=1
    yoko.append(tmp)
else:
    flag=0
    tate.append(tmp)

# print(yoko,tate)

if x>sum(yoko) or y>sum(tate):
    print("No")
    quit()
yokolst=[[0]*(sum(yoko)*2+1) for i in range(len(yoko)+1)]
tatelst=[[0]*(sum(tate)*2+1) for i in range(len(tate)+1)]
yokolst[0][sum(yoko)]=1
tatelst[0][sum(tate)]=1
# print(yokolst)
# print(tatelst)
for i in range(len(tate)):
    for j in range(len(tatelst[0])):
        if tatelst[i][j]==1:
            tatelst[i+1][j+tate[i]]=1
            tatelst[i+1][j-tate[i]]=1


for i in range(len(yoko)):
    for j in range(len(yokolst[0])):
        if yokolst[i][j]==1:
            yokolst[i+1][j+yoko[i]]=1
            yokolst[i+1][j-yoko[i]]=1


# print(yokolst)
# print(tatelst)

if tatelst[-1][sum(tate)+y]==1 and yokolst[-1][sum(yoko)+x]==1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=pow(10,9)+7

s=input()
x,y=map(int,input().split())
lst=[[],[]]
cnt=0
tmp=0
for i in range(len(s)):
    if s[i]=="F":
        tmp+=1
    else:
        if cnt==0:
            x-=tmp
        else:
            if tmp!=0:
                lst[cnt%2].append(tmp)
        tmp=0
        cnt+=1
if cnt==0:
    x-=tmp
elif tmp!=0:
    lst[cnt%2].append(tmp)

sumx=sum(lst[0])
sumy=sum(lst[1])
# print(x,sumx)
if sumx<x or x<-sumx:
    print("No")
    exit()
if sumy<y or y<-sumy:
    print("No")
    exit()
dpx=[[0]*(sumx*2+1) for i in range(len(lst[0])+1)]
dpy=[[0]*(sumy*2+1) for i in range(len(lst[1])+1)]
dpx[0][sumx]=1
dpy[0][sumy]=1

for i in range(len(lst[0])):
    for j in range(sumx*2+1):
        if dpx[i][j]!=0:
            dpx[i+1][j+lst[0][i]]+=1
            dpx[i+1][j-lst[0][i]]+=1

for i in range(len(lst[1])):
    for j in range(sumy*2+1):
        if dpy[i][j]!=0:
            dpy[i+1][j+lst[1][i]]+=1
            dpy[i+1][j-lst[1][i]]+=1

# print(dpx)
# print(dpy)
if dpx[len(lst[0])][sumx+x]!=0 and dpy[len(lst[1])][sumy+y]!=0:
    print("Yes")
else:
    print("No")
from collections import deque


def dfs(current, prev):
    global time
    # node currentを訪問した直後の処理
    ord[current] = time
    low[current] = time
    time += 1
    color[current] = BLACK

    for next in G[current]:
        if color[next] == WHITE:
            # node currentからnode nextへ訪問する直前の処理
            parent[next] = current
            dfs(next, current)

            # node nextの探索が終了した直後の処理
            low[current] = min(low[current], low[next])
        elif next != prev:
            # edge current --> next がback-edgeの場合の処理
            low[current] = min(low[current], ord[next])


def art_points():
    global time
    time = 1
    dfs(0, -1)  # 0をrootとしてlowの計算
    np = 0
    for i in range(1, v):
        p = parent[i]
        if p == 0:
            np += 1
        elif ord[p] <= low[i]:
            ap.add(p)
    if np > 1:
        ap.add(0)


G = {}
v, n = map(int, input().split())
for i in range(0, v):
    G[i] = []
for i in range(n):
    s, t = map(int, input().split())
    G[s].append(t)
    G[t].append(s)
WHITE = 0
BLACK = 2

color = [WHITE] * (v)
parent = [0] * (v)
ord = [0] * (v)
low = [0] * (v)
parent = [0] * (v)
ap = set([])
art_points()
if ap:
    print(*sorted(ap), sep='\n')



### FIXED CODE ###

import sys


from collections import deque
sys.setrecursionlimit(1000000)


def dfs(current, prev):
    global time
    # node currentを訪問した直後の処理
    ord[current] = time
    low[current] = time
    time += 1
    color[current] = BLACK

    for next in G[current]:
        if color[next] == WHITE:
            # node currentからnode nextへ訪問する直前の処理
            parent[next] = current
            dfs(next, current)

            # node nextの探索が終了した直後の処理
            low[current] = min(low[current], low[next])
        elif next != prev:
            # edge current --> next がback-edgeの場合の処理
            low[current] = min(low[current], ord[next])


def art_points():
    global time
    time = 1
    dfs(0, -1)  # 0をrootとしてlowの計算
    np = 0
    for i in range(1, v):
        p = parent[i]
        if p == 0:
            np += 1
        elif ord[p] <= low[i]:
            ap.add(p)
    if np > 1:
        ap.add(0)


G = {}
v, n = map(int, input().split())
for i in range(0, v):
    G[i] = []
for i in range(n):
    s, t = map(int, input().split())
    G[s].append(t)
    G[t].append(s)
WHITE = 0
BLACK = 2

color = [WHITE] * (v)
parent = [0] * (v)
ord = [0] * (v)
low = [0] * (v)
parent = [0] * (v)
ap = set([])
art_points()
if ap:
    print(*sorted(ap), sep='\n')
A, B, K = map(int, input().split())
AB = list(range(A, B+1))
ans = set(AB[:K]) | set(AB[-K:])
 
for i in sorted(ans):
    print(i)

### FIXED CODE ###

a, b, k = map(int, input().split())

if b-a+1 <= 2*k:
    for num in range(a, b+1):
        print(num)
else:
    for num in range(a, a+k):
        print(num)
    for num in range(b-k+1,b+1):
        print(num)
N = int(input())
str1 = input()
str2 = input()

ans = ''
for i in range(0, N):
  ans += str1[i] + str2[i]
print(ans)

### FIXED CODE ###

N = int(input())
str = input()
str = str.split()
str1 = str[0]
str2 = str[1]

ans = ''
for i in range(0, N):
  ans += str1[i] + str2[i]
print(ans)
def main()->None:
    N, C, K = map(int, input().split())
    range_N = range(N)
    T = [int(i) for i in range_N] # バスの出発時刻
    T = sorted(T)
    
    bus = 0
    passenger = 0
    start = 0

    for i in range_N:
        if passenger == 0:
            start = t[i] + K
            passenger = 1

        elif passenger == C:
            bus += 1
            start = t[i] + K
            passenger = 1

        else:
            if t[i] > start:
                bus += 1
                start = t[i] + K
                passenger = 1

            else:
                passenger += 1
    print(bus+1)


if __name__ == "__main__":
    main()

### FIXED CODE ###





def main()->None:
    N, C, K = map(int, input().split())
    range_N = range(N)
    T = [int(input()) for i in range_N] # バスの出発時刻
    T = sorted(T)
    
    bus = 0
    passenger = 0
    start = 0

    for i in range_N:
        if passenger == 0:
            start = T[i] + K
            passenger = 1

        elif passenger == C:
            bus += 1
            start = T[i] + K
            passenger = 1

        else:
            if T[i] > start:
                bus += 1
                start = T[i] + K
                passenger = 1

            else:
                passenger += 1
    print(bus+1)


if __name__ == "__main__":
    main()
N=int(input())
H=list(map(int,input().split()))
dplist=[0 for i in range(N)]
dplist[0]=0
dplist[1]=H[1]-H[0]
for i in range(2,N-1):
  dplist[i]=min(dplist(i-1)+abs(H[i]-H[i-1]),dplist(i-2)+abs(H[i-2]-H[i]))
print(dplist[N-1])

### FIXED CODE ###

N=int(input())
H=list(map(int,input().split()))
dplist=[0 for i in range(N)]
dplist[0]=0
dplist[1]=abs(H[1]-H[0])
for i in range(2,N):
  dplist[i]=min(dplist[i-1]+abs(H[i]-H[i-1]),dplist[i-2]+abs(H[i-2]-H[i]))
print(dplist[N-1])
n=int(input())
dat = list(map(int, input().split()))
dan = []
for e in dat:
    e = str(bin(e))
    e=e[2:]
       
for e in dat:
      j = -1
     while j > -len(e):
           if e[j]=='1':
                break
            else:
                j = j -1

         
           




### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
X,Y,A,B,C = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
ans = 0

for i in range(X):
    if A[0] >= C[0]:
        ans += A[0]
        A.pop(0)
    else:
        ans += C[0]
        C.pop(0)

for i in range(Y):
    if B[0] >= C[0]:
        ans += B[0]
        B.pop(0)
    else:
        ans += C[0]
        C.pop(0)
        
print(ans)

### FIXED CODE ###

X,Y,a,b,c = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort()
B.sort()
C.sort()

ans = 0
if X < a:
    A = A[a-X:]
if Y < b:
    B = B[b-Y:]
ans = 0
for i in range(X+Y):
    if len(A) == 0:
        A.append(0)
    if len(B) == 0:
        B.append(0)
    if len(C) == 0:
        C.append(0)
    if max(A[-1],B[-1],C[-1]) == A[-1]:
        ans += A[-1]
        A.pop()
    elif max(A[-1],B[-1],C[-1]) == B[-1]:
        ans += B[-1]
        B.pop()
    else:
        ans += C[-1]
        C.pop()
print(ans)
h, w = map(int, input().split())
 
a = [list(input()) for i in range(h)]
 
for i in range(h):
  if "#" not in a[i]:
    del a[i]
 
aT = zip(*a)
 
for i in range(len(aT)):
  if "#" not in aT[i]:
    del aT[i]
 
a = zip(*aT)
 
for i in a:
  print(i)

### FIXED CODE ###

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

a = [list(input()) for i in range(h)]

a = [x for x in a if "#" in x]

aT = list(zip(*a))
aT = [x for x in aT if "#" in x]

a = list(zip(*aT))

for i in a:
    print("".join(i))
_, k, s = map(int, open(0).read().split())
s[k-1] == chr(ord(s[k-1])+26)
print(s)

### FIXED CODE ###

k = int(input()[2:])
s = list(input())
s[k-1] = chr(ord(str(s[k-1])) + 32)
print("".join(s))
_ = input()
S = input().lstrip('.').rstrip('#')
n = len(S)

x = 0
y = S.count('.')
c = min(n-y, y)
for i in range(n):
  if S[i] == '#':
    x += 1
  else:
    y -= 1
  c = min(ans, x+y)
print(c)


### FIXED CODE ###

_ = input()
S = input().lstrip('.').rstrip('#')
n = len(S)
A = list(S)

x = 0
y = S.count('.')
ans = min(n-y, y)
for i in range(n):
  if S[i] == '#':
    x += 1
  else:
    y -= 1
  ans = min(ans, x + y)
print(ans)
import math
n = int(input())
c = []
s = []
f = []
for i in range(n-1):
  x,y,z = map(int, input().split())
  c += [x]
  s += [y]
  f += [z]
  
for i in range(n-1):
  ans = s[i]+c[i]
  for j in range(i+1, n-1):
    ans = (ans//f[j]) * math.ceil(ans/f[j]) + c[j]
  print(ans)
print(0)

### FIXED CODE ###

a,b = map(int,input().split())
s = input()
for i in range(a+b+1):
  if i == a:
    if s[i] != '-':
      print('No')
      exit()
  else:
    if not '0' <= s[i] <= '9':
      print('No')
      exit()
  
print('Yes')
from collections import deque
import sys
sys.setrecursionlimit(4100000)
def main():
    H, W = map(int, input().split())
    A = [list(input()) for _ in range(H)]
    Q = deque([])
    for h in range(H):
        for w in range(W):
            if A[h][w] == '#':
                Q.append((h,w))
    visited = [[0] * W for _ in range(H)]
    dx = [1,0,-1,0]
    dy = [0,1,0,-1]
    while Q:
        x, y = Q.popleft()
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]

            if 0 <= nx < W and 0 <= ny < H and not visited[ny][nx]:
                visited[ny][nx] = min(visited[y][x] + 1,visited[ny][nx])
                Q.append((ny,nx))

    ans = 0
    for h in range(H):
        ans = max(ans, max(visited[h]))

    print(ans)




if __name__ == "__main__":
    main()

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(4100000)
def main():
    H, W = map(int, input().split())
    A = [list(input()) for _ in range(H)]
    Q = deque([])
    visited = [[float('inf')] * W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if A[h][w] == '#':
                Q.append((h,w))
                visited[h][w] = 0
    dx = [1,0,-1,0]
    dy = [0,1,0,-1]
    ans = 0
    while Q:
        y, x = Q.popleft()
        now = visited[y][x]
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]

            if 0 <= nx < W and 0 <= ny < H:
                if visited[ny][nx] == float('inf'):
                    visited[ny][nx] = now + 1
                    Q.append((ny,nx))
                    ans = max(ans, now + 1)

    print(ans)




if __name__ == "__main__":
    main()
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

print(lcm(a, b))

### FIXED CODE ###

import math

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

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

print(lcm(a, b))
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)

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

### FIXED CODE ###

from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

N = int(input())
A = list(map(int,input().split()))
answer = gcd_list(A)
print(answer)
a = list(input())
even_number = range(0,101,2)
values,count = *zip(a.most_common())

if even_number in count:
  print("Yes")
else:
  print("No")



### FIXED CODE ###

a = list(input())
even_number = [x for x in range(0,101,2)]
tmp_list = []
tmp_set = set(a)

tmp_list = [a.count(x) for x in tmp_set]
if all(x % 2 == 0 for x in tmp_list) == True:
    print("Yes")
else:
    print("No")
x,y,z = list(map(int,input().split()))
 
def swap(a,b):
    temp = a
    a = b
    b = tmp
    return (a,b)
 
x,y = swap(x,y)
x, z = swap(x, z)
print(x,y,z)

### FIXED CODE ###

x,y,z = list(map(int,input().split()))
 
def swap(a,b):
    tmp = a
    a = b
    b = tmp
    return (a,b)
x,y = swap(x,y)
x,z = swap(x, z)
print(x,y,z)
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

count = [0 for i in range(10**5)]

for a_i in A:
    count[a_i] += 1

bef_ans = 0
for i in range(Q):
    B, C = map(int, input().split())
    tmp = count[B]
    count[B] = 0
    count[C] += tmp
    ans = 0
    if i == 0:
        for j in range(10**5):
            ans += j*count[j]
    else:
        ans = bef_ans - B*tmp + C*tmp
    print(ans)
    bef_ans = ans


### FIXED CODE ###

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

count = [0 for i in range(10**5+1)]

for a_i in A:
    count[a_i] += 1

bef_ans = 0
for i in range(Q):
    B, C = map(int, input().split())
    tmp = count[B]
    count[B] = 0
    count[C] += tmp
    ans = 0
    if i == 0:
        for j in range(10**5+1):
            ans += j*count[j]
    else:
        ans = bef_ans - B*tmp + C*tmp
    print(ans)
    bef_ans = ans
n=int(input())
a=[i*40000 for i in range(n)]
b=[i*40000 for i in range(n-1,-1,-1)]
p=list(map(int,input().split()))
for i in range(n):
  a[p[i]]+=i
  b[p[i]]+=i
print(*a)
print(*b)

### FIXED CODE ###

N = int(input())
P = list(map(int,input().split()))
A = [45678 * i for i in range(1, N + 1)]
B = A[::-1]
for i, p in enumerate(P):
    A[p - 1] += i
    B[p - 1] += i
print(*A)
print(*B)
N,M=map(int,input().split())
A=list(map(int,input().split()))
B=[2,5,5,4,5,6,3,7,6]


dp=[0]*(N+1)
for j in range(M):
    need=B[A[j]-1]
    dp[need]=max(dp[need],A[j])

for i in range(1,N+1):
    for j in range(M):
        need=B[A[j]-1]
        if i-need>=0:
            if dp[i-need]:
                dp[i]=max(dp[i], dp[i-need]*10+dp[need])
            
print(dp[-1])



### FIXED CODE ###

import queue
from collections import defaultdict
import copy

N,M=map(int,input().split())
A=list(map(int,input().split()))
ma=[2,5,5,4,5,6,3,7,6]
BA=[[0,0] for _ in range(M)] #(必要本数，-1*数字)
for i in range(M):
    BA[i][1]=-1*A[i]
    BA[i][0]=ma[A[i]-1]
    
BA.sort()

#同じ本数使うものを消去
can=[]
ii=0
while ii <len(BA):
    if BA[ii][0] in can:
        BA.pop(ii)
    else:
        can.append(BA[ii][0])
        ii+=1
M=len(BA)#Mの書き換え

diff=[0]*M#数字変更の際に追加で必要な本数
for i in range(M):
    diff[i]=BA[i][0]-BA[0][0]
    BA[i][1]=BA[i][1]*-1#(必要本数，数字)に直しておく

fi=BA[0]###
#BA.sort(key=lambda x: x[1]*-1)#数字の大きいもの順


    
p=[1]*(N+1)
for i in range(N):
    p[i+1]=p[i]*10

#数字のセットL(sort済み)から作れる最大の数値を出力
def set_to_num(L):
    ans=0
    for i in range(len(L)):
        ans+=L[i]*p[i]
    return ans

#2つの配列を合わせる
def make_set(temp,L):
    ori=copy.deepcopy(temp)
    for i in range(len(L)):
        ori[i]=L[i]
    ori.sort()
    return ori
    

#dd用hash
def make_h(L):
    h=0
    for i in range(len(L)):
        h+=p[i]*L[i]
    return h
    
    
ans=-1
Max_dig=N//fi[0]

for d in range(Max_dig):#減らす桁数
    dig=Max_dig-d
    rem=N-fi[0]*dig
    temp=[fi[1]]*dig
    dd = defaultdict(int)
    q=queue.Queue()
    q.put((rem,[]))#残り本数，入れ替える数字
    
    while not q.empty():
        rem2,L=q.get()
        if rem2==0:
            #print(temp,L)
            LLL=make_set(temp,L)
            #print(LLL)
            ans=max(ans,set_to_num(LLL))
        else:
            for i in range(1,M):#変更候補の数字を見ていく.0番は自身のためのぞく
                if rem2>=diff[i]:
                    LL=copy.deepcopy(L)
                    LL.append(BA[i][1])
                    if len(LL)<=len(temp):
                        LL.sort()
                        h=make_h(LL)
                        if dd[h]==0:
                            q.put((rem2-diff[i],LL))
                            dd[h]=1
    if ans!=-1:
        break
        
print(ans)
N, M = map(int, input().split())
A = [int(input().split()) for i in range(M)]
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

### FIXED CODE ###

N, M = map(int, input().split())
A = input().split()
B = [ ]
for i in range(M):
  B.append(int(A[i]))
if(sum(B) == N):
  print('0')
elif(sum(B) < N):
  print(N - sum(B))
else:
  print('-1')
s=int(input())
t=input()

if a>=3200:
  print(s)
else:
  print('red')

### FIXED CODE ###

a=int(input())
s=input()

if a>=3200:
  print(s)
else:
  print('red')
N = input()
1<=N(int)<=100

if N(int)%2 != 0:
  print(N(int))

### FIXED CODE ###

N = input()
1 <= int(N) <= 100

if int(N) % 2 == 0:
  print(float(1/2))

else:
  x = (int(N)+1)/2
  print(float(x/int(N)))