Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = sorted(zip(B, A))
B, A = zip(*C)
D = sorted((a, i) for i, a in enumerate(A))
E, indices = zip(*D)
for e, b in zip(E, B):
  if e > b:
    print("No")
    exit()
S = {0}
now = 0
for _ in range(n-1):
  if indices[now] in S:
    print("Yes")
    exit()
  now = indices[now]
  S.add(now)
for i in range(n):
  if E[i+1] <= B[i]:
    print("Yes")
    exit()
print("No")

### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = sorted(zip(B, A))
B, A = zip(*C)
D = sorted((a, i) for i, a in enumerate(A))
E, indices = zip(*D)
for e, b in zip(E, B):
  if e > b:
    print("No")
    exit()
S = {0}
now = 0
for _ in range(n-1):
  if indices[now] in S:
    print("Yes")
    exit()
  now = indices[now]
  S.add(now)
for i in range(n-1):
  if E[i+1] <= B[i]:
    print("Yes")
    exit()
print("No")
while 1:
    w=raw_input()
    if w=='-': break
    n=int(raw_input())
    for i in xrange(n):
        l=int(raw_input())
        w=w[l:]+l[:l]
    print w

### FIXED CODE ###

while 1:
    w=raw_input()
    if w=='-': break
    n=int(raw_input())
    for i in range(n):
        l=int(raw_input())
        w=w[l:]+w[:l]
    print w
n = int(input())
X = [int(i) for i in input().split(" ")]
Y = [int(i) for i in input().split(" ")]

for p in range(1, 4):
    print("{:.6f}".format(sum( [abs(a - b) ** p) for a, b in zip(X,Y) ] ) ** (1 / p) ) )

print("{:.6f}".format(max( [ abs(a - b) for a, b in zip(X, Y) ] ) ) )
 

### FIXED CODE ###

n = int(input())
X = [int(i) for i in input().split(" ")]
Y = [int(i) for i in input().split(" ")]

for p in range(1, 4):
    print("{:.6f}".format(sum( [abs(a - b) ** p for a, b in zip(X,Y) ] ) ** (1 / p) ) )

print("{:.6f}".format(max( [ abs(a - b) for a, b in zip(X, Y) ] ) ) )
import math
from functools import reduce

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

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


n,x = map(int, input().split())

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

a = []

for i in range(n):
    tmp = abs(w[i]-x)
    a.append(tmp)
    
#ans = a[0]
#
#for i in range(1, n):
#    now = a[i]
    
print(gcd_list(a))

### FIXED CODE ###


#import functools
#import math

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

n,x = map(int, input().split())

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

a = []

for i in range(n):
    tmp = abs(w[i]-x)
    a.append(tmp)
    
ans = a[0]

for i in range(1, n):
    now = a[i]
    ans = gcd(ans, now)
    
print(ans)

#print(functools.reduce(math.gcd, a))
value = input().split()
age = int(value[0])
cost = int(value[1])

if(age >= 6 and age<= 12):
    result = cost // 2
elif(age <= 5):
    result = 0

print(result)


### FIXED CODE ###

value = input().split()
age = int(value[0])
cost = int(value[1])

if(age >= 6 and age<= 12):
    cost = cost // 2
elif(age <= 5):
    cost = 0

print(cost)
from collections import defaultdict
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline


road_dict=defaultdict(list)

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

for _ in range(M):
    A,B=map(int,input().split())
    road_dict[A].append(B)
    road_dict[B].append(A)

result_dict=defaultdict(list)

def next_tansaku(kiten,counter):
    for i in road_dict[kiten]:
        if (i not in result_dict) or (result_dict[i][1]>counter):
            result_dict[i]=[kiten,counter]
            road_dict[kiten].remove(i)
            next_tansaku(i,counter+1)


next_tansaku(1,0)

print('Yes')
for k in range(2,N+1):
    print(result_dict[k][0])

### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline


road_dict=defaultdict(list)

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

for _ in range(M):
    A,B=map(int,input().split())
    road_dict[A].append(B)
    road_dict[B].append(A)

result_dict=defaultdict(int)

next_list=[]
for i in road_dict[1]:
    if i not in result_dict:
        result_dict[i]=1
        next_list.append(i)

taisho_list=next_list[:]

while True:
    next_list=[]

    if len(taisho_list)==0:
        break

    for j in taisho_list:
        for k in road_dict[j]:
            if k not in result_dict:
                result_dict[k]=j
                next_list.append(k)
    taisho_list=next_list[:]


print('Yes')
for k in range(2,N+1):
    print(result_dict[k])
import math
N, M = map(int, input().split())
mx = 0
for i in range(1, math.floor(math.sqrt(M))+1):
    if M % i == 0:
        if M // i >= N:
            mx = max(mx, i)
    	if i >= N:
        	mx = max(mx, M//i)
print(mx)

### FIXED CODE ###

N, M = map(int, input().split())
ceil = M // N
for i in range(1,ceil+1)[::-1]:
    tmp = M - i * (N - 1)
    if tmp > 0 and tmp % i == 0:
        print(i)
        break
n = int(input())
a = list(map(int,input().split()))

if n%2==0:
    if sorted(a) != [(k//2)*2+1 for k in range(n)]:
        print(0)
    else:
        print(int(2**(n//2) % (10e9+7)))
else:
    if sorted(a)!= [0]+[(k//2+1)*2 for k in range(n-1)]:
        print(0)
    else:
        print(int(2**(n//2) % (10e9+7)))

### FIXED CODE ###

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

if n % 2 == 0:
  k = 1
  l = 0
else:
  k = 0
  l = 1 

a=1000000007
flag = True 
for i,s in enumerate(sa):
  if ((i+l)//2)*2+k != s:
    flag = False
if flag:
  print(2**(n//2) % a)
else:
  print(0)
s=input()
n=len(s)
flag=0


for i in range((n-1)//2):
    if s[i]==s[n-1-i]==s[((n-1)//2)-1-i]:
        flag=flag+1

if v==((n-1)//2)
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s=input()
n=len(s)
s1=s[:(n-1)//2]
flag=0
for i in range(len(s1)//2):
    if(s1[i]!=s1[-1-i]):
        flag=1
        break

s1=s[(n+3)//2-1:]
for i in range(len(s1)//2):
    if(s1[i]!=s1[-1-i]):
        flag=1
        break

for i in range(n//2):
    if s[i]!=s[-1-i]:
        flag=1
        break

if flag==1:
    print("No")
else:
    print("Yes")
while True:
    l=input().split()
    a=int(l[0])
    b=int(l[1])
    if a==0 and b==0:
        break
    else:
        if a%2==0:
            c=a/2
            if b%2==0:
                d=b/2
                while c>0:
                    print(d*"#.")
                    print(d*".#")
                    c=c-2
            else:
                e=b-1
                f=e/2
                while c>0:
                    print(f*"#."+"#")
                    print(f*".#"+".")
                    c=c-2
        else:
            g=a-1
            c=g/2
            if b%2==0:
                h=b/2
                while c>0:
                    print(h*"#.")
                    print(h*".#")
                    c=c-2
                print(h*"#.")
            else:
                i=b-1
                j=i/2
                while c>0:
                    print(j*"#."+"#")
                    print(j*".#"+".")
                    c=c-2
                print(j*"#."+"#")
    print("")


### FIXED CODE ###

flag=1
listForA = []
while flag:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        flag=0
    else:
        index=0
        while index < h:
            if index%2==0:
                if w%2==0:
                    pattern = w//2
                    listForA.append("#."*pattern)
                else:
                    pattern = w//2
                    listForA.append("#."*pattern+"#")
            else:
                if w % 2 == 0:
                    pattern = w//2
                    listForA.append(".#"*pattern)
                else:
                    pattern = w//2
                    listForA.append(".#"*pattern+".")
            index+=1
        listForA.append("")

for a in listForA:
    print(a)
from math import log2, floor
from operator import or_
from functools import reduce

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

bl = [0 for _ in range(floor(log2(max(a)))+1)]
for ai in a :
    aj = ai
    for i in range(floor(log2(ai))+1) :
        if aj & 1 == 1 :
            bl[i] += 1
        aj >>= 1

ans = reduce(or_, map(lambda x : x&1, bl))
if ans :
    print("No")
else :
    print("Yes")

### FIXED CODE ###

from math import log2, floor
from operator import or_
from functools import reduce

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

if max(a) == 0 :
    bl = [0]
else :
    bl = [0 for _ in range(floor(log2(max(a)))+1)]
for ai in a :
    aj = ai
    if ai == 0 :
        pass
    else :
        for i in range(floor(log2(ai))+1) :
            if aj & 1 == 1 :
                bl[i] += 1
            aj >>= 1

ans = reduce(or_, map(lambda x : x&1, bl))
if ans :
    print("No")
else :
    print("Yes")
# -*- coding: utf-8 -*-
# 遅すぎる！
import math
import sys


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

ch,cw = map(int, input().split())
dh,dw = map(int, input().split())

x = [list(input()) for i in range(h)]
for i in range(h):
    for j in range(w):
        if z[i][j]== '.':
            x[i][j] = 0
        else:
            x[i][j] = -1
#print(x)
x[ch-1][cw-1]=1

def tansaku():
    nu = 0
    while 1:
        nutta=0 # 塗ったマス
        for i in range(h):
            for j in range(w):
                if x[i][j] == 1:
                    if i>0:
                        if x[i-1][j]==0:
                            nutta += 1
                            x[i-1][j]=1
                    if j>0:
                        if x[i][j-1]==0:
                            nutta += 1
                            x[i][j-1]=1
                    if i<h-1:
                        if x[i+1][j]==0:
                            nutta += 1
                            x[i+1][j]=1
                    if j<w-1:
                        if x[i][j+1]==0:
                            nutta += 1
                            x[i][j+1]=1
        if nutta==0:
            return nu
        else:
            nu += nutta

def warp():
    y = [[0 for j in range(w)] for i in range(h)]
    nu = 0
    for i in range(h):
        for j in range(w):
            if x[i][j] == 1:
                for p in range(max(i-2,0),min(i+3,h)):
                    for q in range(max(j-2,0),min(j+3,w)):
                        if x[p][q] == 0:
                            y[p][q]=1
                            #print("a",p,q)
                            nu += 1
    for i in range(h):
        for j in range(w):
            if y[i][j]==1:
                x[i][j]=1
                #print("b")
    return nu # これは塗った数よりは多いがnuが1なら0ではない


answer = 0
while(1):
    #print(x,ch,cw,dh,dw)
    nurioe = tansaku()
    #print(x,nurioe)
    if x[dh-1][dw-1]==1:
        print(answer)
        break
    nurioe = warp()
    answer += 1
    #print(x,nurioe)
    if nurioe == 0:
        print(-1)
        break
    


### FIXED CODE ###

# -*- coding: utf-8 -*-
#
import math
import sys

from collections import deque

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

ch,cw = map(int, input().split())
dh,dw = map(int, input().split())

maze =["#"*(w+4) for i in range(2)] + ["##"+input()+"##" for i in range(h)] + ["#"*(w+4) for i in range(2)]
temp = [[-1]*(w+4) for i in range(h+4)]

#print(maze)

q = deque([(ch+1,cw+1)])
temp[ch+1][cw+1]=0

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

while q:
    y,x = q.popleft()
#    print(y,x)
    # aruki
    for i in opt:
        ty,tx = y+i[0], x+i[1]
        if maze[ty][tx]=='#':
            continue
        if (temp[ty][tx] == -1 or temp[ty][tx] > temp[y][x]):
            temp[ty][tx] = temp[y][x] # ikeru
            q.appendleft((ty,tx)) # new ikeru basho tuika
    # warp
    for i in range(-2,3):
        for j in range(-2,3):
            ty,tx = y+i, x+j
            if maze[ty][tx] == "#":
                continue
            if temp[ty][tx] == -1 or temp[ty][tx] > temp[y][x]+1:
                temp[ty][tx] =  temp[y][x]+1
                q.append((ty,tx))  # 
#    print(q)


print(temp[dh+1][dw+1])
n, m = [ int(v) for v in input().split() ]
num_list = [ v for v in input().split() ]
t = n
while:
	if all([ ( v not in num_list ) for v in list(str(i))]):
		print(i)
		break
	t += 1

### FIXED CODE ###


n, m = [ int(v) for v in input().split() ]
num_list = [ v for v in input().split() ]
t = n
while True:
	if all([ ( v not in num_list ) for v in list(str(t))]):
		print(t)
		break
	t += 1
s = input()

if s%2 == 0:
  a = s/2
  b = s/2
else:
  a = s/2
  b = s/2+1

print(a*b)


### FIXED CODE ###

import math

s = int(input())

print(math.ceil(s/2)*math.floor(s/2))
x=int(input(""))
y=int(input(""))
z=int(input(""))
answer= (x-z)//(z+y)
print(answer);

### FIXED CODE ###

X, Y, Z = map(int, input().split())
print((X-Z)//(Y+Z))
K = int(input())
X = int(input())
s = X-K+1
for i in range(2*K -1):
    A = s+i
    print(str(A)+' ')

### FIXED CODE ###

S = input().split()
K = int(S[0])
X = int(S[1])
s = X-K+1
e = X+K-1
for i in range(s, e):
    print(str(i)+' ')
print(e)
def dfs(x):
  if x == N:
    return 1
  if x > N or x in a:
    return 0
  if memo.get(x):
    return memo[x]
  memo[x] = dfs(x+1) + dfs(x+2)
  return memo[x]

N, M = map(lambda x: int(x), input().split())
a = [int(input()) for i in range(M)]
#print(N)
#print(M)
#print(a)
memo = {}
count = dfs(0)
print(count%1000000007) 



### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

def dfs(x):
  if x == N:
    return 1
  if x > N:
    return 0
  if memo[x] >= 0:
    return memo[x]
  memo[x] = dfs(x+1) + dfs(x+2)
  return memo[x]

N, M = map(lambda x: int(x), input().split())
a = [int(input()) for i in range(M)]
#print(N)
#print(M)
#print(a)
memo = [-1]*(N+1)
for ai in a:
  memo[ai] = 0
count = dfs(0)
print(count%1000000007)
n=int(input())
b=[int(i) for i in input().split()]
ans=b[-1]+b[0]
for i,j in z1p(b[:-1],b[1:]):
  ans+=min(i,j)
print(ans)

### FIXED CODE ###

n=int(input())
b=[int(i) for i in input().split()]
ans=b[-1]+b[0]
for i,j in zip(b[:-1],b[1:]):
  ans+=min(i,j)
print(ans)
index = a.index(1)
cnt = 0

if (n==k):
    print(1)
else:
    if index <= (k - 1):
        cnt += 1
        i = k - 1
        while i <= (len(a) - 2):
            i += (k-1)
            cnt += 1
    elif index >= (n - k):
        cnt += 1
        i = n - k
        while i >= 1:
            i -= (k-1)
            cnt += 1
    else:
        i = index
        while i >= 1:
            i -= (k-1)
            cnt += 1

        i = index
        while i <= (len(a) - 2):
            i += (k-1)
            cnt += 1

    print(cnt)

### FIXED CODE ###

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

print(math.ceil((n-1)/(k-1)))
l = int(intput())
e = l / 3.0
print(e*e*e)

### FIXED CODE ###

l = int(input())
e = l / 3
print(e*e*e)
N, K = map(int, input().split())
L = list(map(int, input().split()))
dp = [-1 for k in range(K+1)]
# dp[0] = 1
def fn(n):
	if dp[n] != -1:
		return dp[n]
	if n == 0:
		dp[n] = 0
		return dp[n]
	ans = 0
	for i in L:
		if fn(n-i) == 0:
			ans = 1
			break
	dp[n] = ans		
	return dp[n]
for l in range(K):
	fn(l)
if fn(K) == 1:
	print("First")
else:
	print("Second")

### FIXED CODE ###

N, K = map(int, input().split())
L = list(map(int, input().split()))
dp = [-1 for k in range(K+1)]
# dp[0] = 1
def fn(n):
	if dp[n] != -1:
		return dp[n]
	if n == 0:
		dp[n] = 0
		return dp[n]
	ans = 0
	for i in L:
		if n >= i:
			if fn(n-i) == 0:
				ans = 1
				break
	dp[n] = ans		
	return dp[n]
for l in range(K):
	fn(l)
if fn(K) == 1:
	print("First")
else:
	print("Second")
a = list(map(float, input().split()))
print(f'{a * a * 3.1415926} {2 * a * 3.1415926}')



### FIXED CODE ###

r = float(input())
p = 3.141592653589
print(p*r*r, 2*p*r)
def main():
    n = int(input())
    h = [int(x) for x in input().split()]
    history = [None for i in range(n)]
    print(f(n,h))

def f(n, h):
    if history[n-1] != None:
        return history[n-1]
    if n <= 1:
      	history[0] = 0
        return 0
    elif n == 2:
      	history[1] = abs(h[1]-h[0])
        return history[1]
    else:
        d1 = abs(h[n-1]-h[n-2]) + f(n-1,h)
        d2 = abs(h[n-1]-h[n-3]) + f(n-2,h)
        history[n-1] = min(d1,d2)
        return history[n-1]

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)
def main():
    n = int(input())
    h = [int(x) for x in input().split()]
    memo = [None for i in range(n)]

    def rec(n):
        if memo[n-1] == None:
            if n <= 1:
                memo[n-1] = 0
            elif n == 2:
                memo[n-1] = abs(h[1]-h[0])
            else:
                d1 = rec(n-2)+abs(h[n-1]-h[n-3])
                d2 = rec(n-1)+abs(h[n-1]-h[n-2])
                memo[n-1] = min(d1,d2)
        return memo[n-1]
        
    print(rec(n))

if __name__ == "__main__":
    main()
import bisect
A, B, Q = map(int, input().split())

a=[-float("inf")]
b=[-float("inf")]
for i in range(A):
    a.append(int(input()))
for i in range(B):
    b.append(int(input()))   
a+=[float("inf")]
b+=[float("inf")]

for i in range(Q):
    q = int(input())
    x = bisect.bisect_left(a, q[i])
    y = bisect.bisect_left(b, q[i])
    for j in [a[x-1], a[x]]:
        for k in [b[y-1], b[y]]:
            ans1 = abs(j-q)+abs(j-k)
            ans2 = abs(k-q)+abs(j-k)
            ans = min(ans, ans1, ans2)
    print(ans)

### FIXED CODE ###

import bisect
A, B, Q = map(int, input().split())

a=[-float("inf")]
b=[-float("inf")]
for i in range(A):
    a.append(int(input()))
for i in range(B):
    b.append(int(input()))   
a+=[float("inf")]
b+=[float("inf")]

for i in range(Q):
    q = int(input())
    x = bisect.bisect_left(a, q)
    y = bisect.bisect_left(b, q)
    ans = float("inf")
    for j in [a[x-1], a[x]]:
        for k in [b[y-1], b[y]]:
            ans1 = abs(j-q)+abs(j-k)
            ans2 = abs(k-q)+abs(j-k)
            ans = min(ans, ans1, ans2)
    print(ans)
# -*- coding:utf-8 -*-
import math

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

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


### FIXED CODE ###

# -*- coding:utf-8 -*-

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

c_a = 1

while True:
    if a*c_a%b == 0:
        break
    c_a += 1

print(a*c_a)
S = input()
for i in range(len(S)):
  if S[i] == S[i+1]:
    print("Bad")
    exit()
  else:
    print("Good")

### FIXED CODE ###

S = input()
A = S[0]
B = S[1]
C = S[2]
D = S[3]

if A == B or B ==C or C ==D:
  print("Bad")
else:
  print("Good")
def cut(i, j, num):
  marked[i][j]=num
  if i>0 and cake[i-1][j]=="." and marked[i-1][j]==0:
    cut(i-1, j, num)
  if j>0 and cake[i][j-1]=="." and marked[i][j-1]==0:
    cut(i, j-1, num)
  if i<H-1 and cake[i+1][j]=="." and marked[i+1][j]==0:
    cut(i+1, j, num)
  if j<W-1 and cake[i][j+1]=="." and marked[i][j+1]==0:
    cut(i, j+1, num)

H, W, K=map(int, input().split())
cake=[input() for _ in range(H)]
marked=[[0 for _ in range(W)] for _ in range(H)]
mark=0
for i in range(H):
  for j in range(W):
    if cake[i][j]=="#":
      mark+=1
      cut(i, j, mark)
for i in range(H):
  print(*marked[i])

### FIXED CODE ###

from collections import deque

H, W, K=map(int, input().split())
cake=[input() for _ in range(H)]
rows_list=[]
upper=0
for i in range(H):
  for j in range(W):
    if cake[i][j]=="#":
      rows_list.append([upper, i])
      upper=i+1
      break
rows_list[-1][-1]=H-1
ans_list=[]
for rows in rows_list:
  for i in range(rows[0], rows[1]+1):
    left=0
    for j in range(W):
      if cake[i][j]=="#":
        ans_list.append([rows[0], rows[1], left, j])
        left=j+1
    if ans_list:
      ans_list[-1][-1]=W-1
ans=[[0 for _ in range(W)] for _ in range(H)]
key=1
for l in ans_list:
  for i in range(l[0], l[1]+1):
    for j in range(l[2], l[3]+1):
      ans[i][j]=key
  key+=1
for a in ans:
  print(*a)
import sys


def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif db in k:
            print('yes')
        else:
            print('no')


main()

### FIXED CODE ###

import sys


def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no')


main()
a,b = input( , )

print(2*a+2*b,a*b)

### FIXED CODE ###

nums = input().split(" ")
a =int( nums[0])
b = int(nums[1])

print(a*b, (a+b)*2)
N, M = map(int, input().split())
a = []
b = []
for i in range(M):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)

for i in range(N):
    r = 0
    r += a.count(i+1)
    r += b.count(i+1)
	print(r)

### FIXED CODE ###

N, M = map(int, input().split())
a = []
b = []
for i in range(M):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)

for i in range(N):
    r = 0
    r += a.count(i+1)
    r += b.count(i+1)
    print(r)
a, b, c = map(int, input().split())  # 入力
k = int(input())  # 入力
num_ary = [a, b, c]
max_n = max(num_ary)

max_index = num_ary.index(max_n)#最大値のindex

max_num = max_n * pow(2, k)

num_ary[max_index] = max_num

print(num_ary[0] + num_ary[1] + num_ary[2])





### FIXED CODE ###

a, b = map(int, input().split())  # 入力
if a <=  b:
    print(a)
if b < a:
    print(a-1)
h = int(input())
n = 0
l = []
for i in range(42):
    l.append(2**i)

for i in range(1,41):
    if l[i]<=h<l[i+1]:
        ans=sum(l[:i+1])

print(ans)

### FIXED CODE ###

h = int(input())
n = 0
l = []
ans = 1
for i in range(42):
    l.append(2**i)

for i in range(1,41):
    if l[i]<=h<l[i+1]:
        ans=sum(l[:i+1])

print(ans)
n, m = map(int,input().split())
a = list(map(int,input().split()))
rewrite = []
for i in range(m):
    rewrite.append(list(map(int,input().split())))
rewrite.sort(key= lambda x : x[1], reverse=True)
a.sort()
k = 0
flag = 0
for i in range(min(n,sum(rewrite[0]))):
    for j in range(rewrite[i][0]):
        if rewrite[i][1] > a[k]:
            a[k] = rewrite[i][1]
            k += 1
        else:
            flag = 1
            break
    if flag == 1:
        break
print(sum(a))


### FIXED CODE ###

n, m = map(int,input().split())
a = list(map(int,input().split()))
rewrite = []
for i in range(m):
    rewrite.append(list(map(int,input().split())))
rewrite.sort(key= lambda x : x[1], reverse=True)
a.sort()
k = 0
flag = 0
for i in range(m):
    for j in range(rewrite[i][0]):
        if rewrite[i][1] > a[k]:
            a[k] = rewrite[i][1]
            k += 1
            if k == n:
                flag = 1
                break
        else:
            flag = 1
            break
    if flag == 1:
        break
print(sum(a))
n = input()
s = 0
for i in len(n):
    s += int(n[i])

print(["No","Yes"][n%s == 0])

### FIXED CODE ###

n = int(input())
s = 0
for i in str(n):
    s += int(i)
print("Yes" if n%s == 0 else "No")
n=int(input())
a=[int(input()) for i in range(n)]

al= {}
ds=[]
ans=0
for ai in a:
  ds=
  if ai - 1 in al.keys():
    al[ai]=al[ai-1]+1
    ans=max(ans,al[ai-1]+1)   
    del al[ai-1]
  else:
    al[ai]=0
    if ai + 1 in al.keys():
      del al[ai]
print(n-ans-1)

### FIXED CODE ###

n=int(input())
a=[int(input()) for i in range(n)]

al= {}
ans=0
for ai in a:
  if ai - 1 in al.keys():
    al[ai]=al[ai-1]+1
    ans=max(ans,al[ai-1]+1)   
    del al[ai-1]
  else:
    al[ai]=0
    if ai + 1 in al.keys():
      del al[ai]
print(n-ans-1)
import math
N, D = map(int, input().split())
X = []

for _ in range(N):
    X.append(list(map(int, input().split())))

cnt = 0
for i in range(0, len(X)):
    sum = 0
    for j in range(0, len(X[i])):
        if i >= (len(X)-1):
            sum += X[i][j] - X[0][j]
        else:
            sum += (X[i][j] - X[i+1][j])**2

    if math.sqrt(sum).is_integer():
        cnt += 1
print(cnt)


### FIXED CODE ###

import math
N, D = map(int, input().split())
X = []

for _ in range(N):
    X.append(list(map(int, input().split())))

cnt = 0
for i in range(N):
    for j in range(i+1, N):
        sum = 0
        for k in range(D):
            sum += (X[i][k] - X[j][k])**2
        if math.sqrt(sum).is_integer():
            cnt += 1
print(cnt)
a,b,c = sorted(map(in,input().split()))
print(a+b)
               

### FIXED CODE ###

a,b,c = sorted(map(int,input().split()))
print(a+b)