Harryxun/stf_run huggingface dataset:
N,K,Q = map(int,input().split())
A = list(map(int,input().split()))
B = sorted(A)
L = [[i,B[i+Q-1] - B[i]] for i in range(N-Q+1)]
sL = sorted(L,key=lambda x:x[1])

if Q == 1:
    # 一つしか選ばない -> max == min -> 0
    print(0)
    exit()
if Q == N - K + 1:
    print(L[0][1])
    exit()
if K == 1:
    # 一つずつ選べる -> 必ず最小のパターンに出来る
    print(sL[0][1])
    exit()

if sL[0][0] == 0:
    # minが最小の時 最小のパターンになる時
    print(sL[0][1])
    exit()

a = A[N-K-Q+1:K+Q-1]
# 必ず選ばないといけない要素
if a:
    m_index = B.index(min(a))
    if m_index == 0:
        # 必ず最小値が含まれるなら
        print(L[0][1])
        exit()
    sL = [i for i in sL if i[0] <= m_index]
    # 最小値の幅が狭まるためsLを更新
for key,value in sL:
    f = True
    for b_value in B[key:key+Q]:
        a_index = a.index(b_value)
        length = 1
        for j in range(a_index-1,a_index-K,-1):
            if j < 0:
                break 
            if A[j] < b_value:
                break
            length += 1
        for j in range(a_index+1,a_index+K):
            if j > N-1:
                break 
            if A[j] < b_value:
                break
            length += 1
        if length < K:
            f = False
            break
        
    if f:
        print(value)
        exit()

print(L[0][1])


### FIXED CODE ###

N,K,Q = map(int,input().split())
A = list(map(int,input().split()))
B = sorted(A) # A をソート
L = [[i,B[i+Q-1] - B[i]] for i in range(N-Q+1)] # BからX-Yの最小パターンを出す
sL = sorted(L,key=lambda x:x[1]) # Lをソート

if Q == 1:
    # 一つしか選ばない -> max == min -> 0
    print(0)
    exit()

if Q == N - K + 1:
    # 全部の要素が選ばれる = 必ず最小値が選ばれる
    print(L[0][1])
    exit()

if K == 1:
    # 一つずつ選べる -> 必ず最小のパターンに出来る
    print(sL[0][1])
    exit()

if sL[0][0] == 0:
    # minが最小の時 最小のパターンになる時
    print(sL[0][1])
    exit()

if sL[0][1] == sL[len(sL)-1][1]:
    print(sL[0][1])
    exit()

now_max_value = -1
now_min_value = -1
now_min_XY = int(1e10)

for key,value in sL:
    max_value = B[key + Q - 1]
    min_value = B[key]
    C = [(i if i >= min_value else None) for i in A]
    i = 0
    j = 0
    count = 0
    min_OK = max_OK = False
    while i < N:
        if not C[i]:
            i += 1
            continue
        j = i + 1
        while j < N:
            if not C[j]:
                break
            j += 1
        tmp = (j-i) - K + 1
        if  tmp < 1:
            # 要素を取得できないパターン
            #if min(C[i:j]) < max_value:
            #    count = 0
            #    break
            i = j + 1
            continue
        sC = sorted(C[i:j])
        if not min_OK and (sC[0] == min_value):
            min_OK = True
        if not max_OK and max_value in sC[0:tmp]:
            max_OK = True
        #if sC[tmp] < max_value:
        #    count = 0
        #    break
        count += tmp - len([i for i in sC[:tmp] if i > max_value])
        i = j +1
    if min_OK and max_OK and (count >= Q):
        print(value)
        exit()
    now_min_XY = min(now_min_XY,now_max_value - now_min_value)
    now_max_value = -1
    now_min_value = -1

print(L[0][1])
s=str(input())
t=str(input())

print("{}{}".format(t,s))

### FIXED CODE ###

b, c = map(str, input().split())

print(c+b)
x,y,a,b,c = map(int, input().split())
p1 = list(map(int, input().split()))
p2 = list(map(int, input().split()))
p3 = list(map(int, input().split()))
ans1 = 0
ans2 = 0
p1.sort(reverse = True)
p2.sort(reverse = True)
p3.sort(reverse = True)
for i in range(0,x):
  ans1= ans1 + max(p1[i],p3[0])
  if(p3[0]>p1[i]):
    del p3[0]
for i in range(0,y):
  ans2= ans2 + max(p2[i],p3[0])
  if(p3[0]>p2[i]):
    del p3[0]
print(ans1+ans2)



### FIXED CODE ###

x,y,a,b,c = map(int, input().split())
p1 = list(map(int, input().split()))
p2 = list(map(int, input().split()))
p3 = list(map(int, input().split()))
p1.sort(reverse= True)
p2.sort(reverse= True)
ans =p1[:x]+p2[:y]+p3
ans.sort(reverse= True)
print(sum(ans[:x+y]))
A B = list(map(int,input().split()))
print(A * B)

### FIXED CODE ###

A,B = list(map(int,input().split()))
print(A * B)
if __name__ == '__main__':
	input_a = input()
	input_b = input()
	
	print input_a*input_b," ",2*input_a+2*input_b

### FIXED CODE ###

n, m = map(int, raw_input().split())
print n*m, 2*n+2*m
N = input()
X = list(map(int, input().split()))
sum = 0
for a in X:
    sum = sum + a
C = sum/N
ans = 0
for b in X:
    ans = ans + (b-C)**2
print(int(ans))


### FIXED CODE ###

N = int(input())
X = list(map(int, input().split()))
sum = 0
all = True
for a in X:
    sum = sum + a
C = int(sum / N + 0.5)
ans = 0
for b in X:
    ans = ans + (b-C)**2
print(ans)
import numpy as np
n,k = map(int,input().split())

a = np.array(input().split(),np.int)

F = np.array(input().split(),np.int)


A.sort()
F.sort()

F = F[::-1]

left = -1
right = (A * F).sum()

while (right - left) > 1:
    b = np.zeros(n,dtype = int)
    s = left + ((right - left) // 2)
    for i in range(n):
        b = np.minimum(s//F,A)
    if (A - b).sum() <= k:
        right = s 
    else:
        left = s 

print(right)


### FIXED CODE ###

import numpy as np
n,k = map(int,input().split())

A = np.array(input().split(),np.int)

F = np.array(input().split(),np.int)


A.sort()
F.sort()

F_ = F[::-1]

left = -1
right = (A * F_).sum()

while (right - left) > 1:
    s = (left + right) // 2
    r = np.maximum(0, A - s // F_).sum() <= k
    if r:
        right = s 
    else:
        left = s 

print(right)
I=lambda:map(int,input().split())
n,m=I()
g=[[]for _ in range(n+1)]
v=[0 for _ in range(n+1)]
v[1]=1

for _ in range(m):
  a,b=I()
  g[a]+=[b]
  g[b]+=[a]
  
def dfs(x):
  for j in g[x]:
    if v[j]==0:
      v[j]=1
      return [j]+dfs(j)
      break
  else:
    return []
z=dfs(1)[::-1]+[1]+dfs(1)
print(len(z))
print(*z)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
I=lambda:map(int,input().split())
n,m=I()
g=[set() for _ in range(n+1)]
v=[1 for _ in range(n+1)]
v[1]=0

for _ in range(m):
  a,b=I()
  g[a].add(b)
  g[b].add(a)

def dfs(x):
  for j in g[x]:
    if v[j]:
      v[j]=0
      l=dfs(j)
      l.append(j)
      return l
      break
  else:
    return []
z=dfs(1)+[1]+dfs(1)[::-1]
print(len(z))
print(*z)
a=map(int, raw_input().split())
a=sorted(a)
for i in range(2):
    print L[i] 

### FIXED CODE ###

a = map(int, raw_input().split())
a.sort()
for i in range(len(a)):
    print a[i],
print(int(input().count("+"))+(-1*int(input().count("-"))))

### FIXED CODE ###

print(4-input().count("-")*2)
N, X = map(lambda x: int(x), input().split())[:2]
L = map(lambda x: int(x), input().split())
D = 0
count = 0
for i, l in enumerate(L):
if D <= X:
    count += 1
D += int(l)
print(count)

### FIXED CODE ###

N, X = map(int, input().split())
L = map(int, input().split())
D = 0
count = 1
for i, l in enumerate(L):
  D += l
  if D <= X:
      count += 1
print(count)
w= input().lower()
 
count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
 
    for s in line.lower().split():
        if s == W:
            count += 1
 
print(count)

### FIXED CODE ###

W = input()
 
count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
     
    for s in line.lower().split():
        if s == W:
            count += 1
             
         
     
print(count)
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [i//2 for i in a]

def f(x):
  cnt = 0
  while x%2 == 0:
    x /= 2
    cnt += 1
  return cnt

def gcd(x, y):
  if y:
    return gcd(y, x%y)
  else:
    return x

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

t = f(a[0])
for i in range(1, t):
  if f(a[i]) != t:
    ans = 0
    break
  a[i] >>= t
m >>= t

l = 1
for i in range(n):
  l = lcm(l, a[i])
  if l > m:
    ans = 0
    break

m //= l
ans = (m+1) // 2
print(ans)

### FIXED CODE ###

import sys

def f(x):
  cnt = 0
  while x%2 == 0:
    x /= 2
    cnt += 1
  return cnt

def gcd(x, y):
  if y:
    return gcd(y, x%y)
  else:
    return x

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


n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [i//2 for i in a]

t = f(a[0])
for i in range(n):
  if f(a[i]) != t:
    print(0)
    sys.exit()
  a[i] >>= t
m >>= t

l = 1
for i in range(n):
  l = lcm(l, a[i])
  if l > m:
    print(0)
    sys.exit()

m //= l
ans = (m+1) // 2
print(ans)
def combination(n,r):
    n_=1
    r_=1
    n_r=1
    for i in range(1,n+1):
        n_*=i
    for i in range(1,n-r+1):
        n_r*=i
    for i in range(1,r+1):
        r_*=i

    return n_//(n_r*r_)

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

    ball_dic={}

    for a in A:
        if a in ball_dic.keys():
            ball_dic[a]+=1
        else:
            ball_dic[a]=1


    all_patern=0

    combination_dic={}

    for key in ball_dic.keys():
        if ball_dic[key]>=2:
            if (ball_dic[key] in combination_dic.keys()) is False:
                combination_dic[ball_dic[key]] = combination(ball_dic[key], 2)
            all_patern += combination_dic[ball_dic[key]]

    for a in A:
        if ball_dic[a]-1<2:
            res=all_patern-combination_dic[ball_dic[a]]
        else:
            com=combination_dic[ball_dic[a]]
            res=all_patern-com+(com*(ball_dic[a]-2)//ball_dic[a])

        print(res)

if __name__=="__main__":
    main()

### FIXED CODE ###

def combination(n,r):
    n_=1
    r_=1
    for i in range(n,n-r,-1):
        n_*=i
    for i in range(1,r+1):
        r_*=i

    return n_//r_

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

    ball_dic={}

    for a in A:
        if a in ball_dic.keys():
            ball_dic[a]+=1
        else:
            ball_dic[a]=1


    all_patern=0

    combination_dic={}

    for key in ball_dic.keys():
        if ball_dic[key]>=2:
            if (ball_dic[key] in combination_dic.keys()) is False:
                combination_dic[ball_dic[key]] = combination(ball_dic[key], 2)
            all_patern += combination_dic[ball_dic[key]]

    for a in A:
        if ball_dic[a]-1<2:
            if ball_dic[a] in combination_dic.keys():
                res=all_patern-combination_dic[ball_dic[a]]
            else:
                res=all_patern
        else:
            com=combination_dic[ball_dic[a]]
            res=all_patern-com+(com*(ball_dic[a]-2)//ball_dic[a])

        print(res)

if __name__=="__main__":
    main()
n = int(input())
A = [int(i) for i in input().split()]
the = pow(10,18)
ans = 1

while ans <the:
    if 0 in A:
        print(0)
        ans = the
        break
    ans *= A[i]

if ans < the:
    print(ans)

### FIXED CODE ###

n = int(input())
A = [int(i) for i in input().split()]
the = pow(10,18)
ans = 1

if 0 in A:
    print(0)
else:
    for i in range(n):
        ans *= A[i]
        if ans >the:
            print(-1)
            break
        else:
            continue
    if ans <= the:
        print(ans)
from collections import defaultdict
n,k,l = map(int, input().split())


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * n
        self.size = [1] * n

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
            self.size[x] = 0
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            self.size[y] = 0
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # すべての頂点に対して親を検索する
    def all_find(self):
        for n in range(len(self.par)):
            self.find(n)


D = defaultdict(int)

uf = UnionFind()
tf = UnionFind()
n,k,l =  map(int, input().split())
dp =[1]*n
for i in range(k):
    x,y =map(int, input().split())
    uf.unite(x-1, y-1)  # (3)
for i in range(l):
    x,y =map(int, input().split())
    tf.unite(x-1, y-1)  # (3)
tf.all_find()
uf.all_find()
D = defaultdict(int)
for r, t in zip(uf.par, tf.par):
    D[(r, t)] += 1
 
ans = [D[(r, t)] for r, t in zip(uf.par, tf.par)]
print(*ans, sep=' ')

### FIXED CODE ###

from collections import defaultdict


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * n
        self.size = [1] * n

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
            self.size[x] = 0
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            self.size[y] = 0
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # すべての頂点に対して親を検索する
    def all_find(self):
        for n in range(len(self.par)):
            self.find(n)


D = defaultdict(int)
n,k,l =  map(int, input().split())
uf = UnionFind(n)
tf = UnionFind(n)

dp =[1]*n
for i in range(k):
    x,y =map(int, input().split())
    uf.union(x-1, y-1)  # (3)
for i in range(l):
    x,y =map(int, input().split())
    tf.union(x-1, y-1)  # (3)
tf.all_find()
uf.all_find()
D = defaultdict(int)
for r, t in zip(uf.par, tf.par):
    D[(r, t)] += 1
 
ans = [D[(r, t)] for r, t in zip(uf.par, tf.par)]
print(*ans, sep=' ')
import math
from functools import reduce
input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))

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

def lcm(num):
    return reduce(lcmB,num)

print(int(lcm(data) - 1))

### FIXED CODE ###

input()
ip = input().split()
data = []
ans = 0
for i in ip:
    ans += int(i) - 1

print(ans)
fl = input()
sl = input()

koma_num, pos_num = [int (x) for x in fl.split(" ")]
poses = [int(x) for x in sl.split(" ")]
poses.sort()

if koma_num >= pos_num:
    print("0")

dists = []
total = 0
for n in range(pos_num-1):
    dist = poses[n+1] - poses[n]
    dists.append(dist)
    total += dist

dists.sort()
dists.reverse()

for n in range(koma_num-1):
    total -= dists[n]

print(total)


### FIXED CODE ###

fl = input()
sl = input()

koma_num, pos_num = [int (x) for x in fl.split(" ")]
poses = [int(x) for x in sl.split(" ")]
poses.sort()

if koma_num >= pos_num:
    print("0")
    exit()

dists = []
total = 0
for n in range(pos_num-1):
    dist = poses[n+1] - poses[n]
    dists.append(dist)
    total += dist

dists.sort()
dists.reverse()

if(len(dists) == 0):
    print("0")
    exit()

for n in range(koma_num-1):
    total -= dists[n]

print(total)
input()
li=list(map(int,input().split()))
for i in li:
	sum+=i
print(min(li),max(li),sum)


### FIXED CODE ###

input()
li=list(map(int,input().split()))
sum=0
for i in li:
	sum+=i
print(min(li),max(li),sum)
from  functools import reduce
from  math import gcd
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=[i//2 for i in a]
#print(a)
lc=reduce(lambda x,y: (x*y)//gcd(x,y) , a)
#print(lc)
flag=True
for i in a:
  if (lc//i)%2==0:
    flag=False
    break
if flag==False:
  print(0)
else:
  x=m//lc
  print(x//2) if x%2==0 else print(x//2+1)


### FIXED CODE ###

from  functools import reduce
def gcd(v1,v2):
  v=v1%v2
  if v==0:
    return v2
  else :
    return gcd(v2,v)
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=[i//2 for i in a]
#print(a)
lc=reduce(lambda x,y: (x*y)//gcd(x,y) , a)
#print(lc)
flag=True
for i in a:
  if (lc//i)%2==0:
    flag=False
    break
if flag==False:
  print(0)
else:
  x=m//lc
  print(x//2) if (x%2)==0 else print((x//2)+1)
N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[-1]
A = [min(B[i],B[i+1] for i in range(N-2)]
C = sum(k + A)
print(C)


### FIXED CODE ###

N=int(input())
n= N*N*N
print(n)
N,i=map(int,input())

a=(N-i+1)

print(a)

### FIXED CODE ###

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

a=(N-i+1)

print(a)
import numpy as np


def main():
    H, W = [int(x) for x in input().split()]
    board = [[0 for i in range(H)] for j in range(W)]

    """ #は1, .は0 """
    for i in range(H):
        X = input()
        for j in range(len(X)):
            if X[j] == "#":
                board[i][j] = 1

    num_board = np.array(board)
    height, width = num_board.shape[:2]
    count = 0
    height_r, width_r = range(height), range(width)
    while (np.sum(num_board) != height*width):
        num_board_ans = np.zeros((height, width))
        for i in height_r:
            for j in width_r:
                if num_board[i, j] == 1:
                    num_board_ans[i, j] = 1
                    a = max(i-1, 0)
                    num_board_ans[a, j] = 1
                    b = max(j-1, 0)
                    num_board_ans[i, b] = 1
                    c = min(i+1, height-1)
                    num_board_ans[c, j] = 1
                    d = min(j+1, width-1)
                    num_board_ans[i, d] = 1
        num_board = num_board_ans
        count += 1

    print(count)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import deque


def bfs(h, w, board, visited):
    queue = deque([])
    for i in range(h):
        for j in range(w):
            if board[i][j] == "#":
                queue.append([i, j])
                visited[i][j] = 0
    ans = 0
    while queue:
        y, x = queue.popleft()
        for i, j in ([1, 0], [0, 1], [-1, 0], [0, -1]):
            yn, xn = y+i, x+j
            if yn >= h or xn >= w or yn < 0 or xn < 0:
                continue
            if visited[yn][xn] == -1 and board[yn][xn] == ".":
                visited[yn][xn] = visited[y][x] + 1
                queue.append([yn, xn])
                ans = max(ans, visited[yn][xn])

    return ans


def main():
    h, w = map(int, input().split())
    board = [input() for _ in range(h)]
    visited = [[-1 for _ in range(w)] for _ in range(h)]
    print(bfs(h, w, board, visited))


if __name__ == "__main__":
    main()
n, l = (map(int, input().split()))
ss = []
for i in range(n):
    ss.append(input())

ss.sort()
print(str.join(ss))


### FIXED CODE ###

n, L = (map(int, input().split()))
ss = []
for i in range(n):
    ss.append(input())

ss.sort()
print("".join(ss))
s = input().split()
i = s[0]
m = int(s[1])
j = 0
el = input().split()
for p in el:
    if int(p) < 1 / (4 * m):
      j = 1 
if j == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

el = input().split()
print("{} {} {}".format(el[2],el[0],el[1]))
N = int(input())
edges = []
connected = [[] for i in range(N+1)]
for i in range(N-1):
    x=list(map(int, input().split()))
    edges.append(x)
    connected[x[0]].append([x[1], x[2]])
    connected[x[1]].append([x[0], x[2]])

Q,K = map(int, input().split())
depth = [0]*(N+1)
def DFS(v, p, d):
    depth[v] = d
    for child in connected[v]:
        if child[0] == p:
            continue
        DFS(child[0], v, d+child[1])

DFS(K,-1,0)
for i in range(Q):
    xi, yi = map(int, input().split())
    print(depth[xi]+depth[yi])

    


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)

N = int(input())
edges = []
connected = [[] for i in range(100010)]
for i in range(N-1):
    x=list(map(int, input().split()))
    x[0] -= 1
    x[1] -= 1
    edges.append(x)
    connected[x[0]].append([x[1], x[2]])
    connected[x[1]].append([x[0], x[2]])

Q,K = map(int, input().split())
K -= 1
depth = [0]*100010
def DFS(v, p, d):
    depth[v] = d
    for child in connected[v]:
        if child[0] == p:
            continue
        DFS(child[0], v, d+child[1])

DFS(K,-1,0)
for i in range(Q):
    xi, yi = map(int, input().split())
    print(depth[xi-1]+depth[yi-1])
import math
A,B,C,D = map(int, input().split())

t = (C * D) / math.gcd(C, D)

m = B - (math.floor(B / C) + math.floor(B / D) - math.floor(B / (t)))
 
n = A - 1 - (math.floor((A-1) / C) + math.floor((A-1) / D ) - math.floor((A-1) / (t)))

print(m-n)

### FIXED CODE ###

from fractions import gcd
 
A, B, C, D = map(int, input().split())
t = C * D // gcd(C, D)
print((B - (A - 1)) - (B//C + B//D - B//t) + ((A-1)//C + (A-1)//D - (A-1)//t))
def cmb(n, r):
  n_ = math.factorial(n)
  n_r_ = math.factorial(n-r) 
  r_ = math.factorial(r)
  return n_//(r_*n_r_)

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

for i in range(1, k+1):
  if n-k+1 >= i:
    ans =  cmb(n-k+1,i)*cmb(k-1,i-1)%(10**9+7)
  else:
    ans
  print(ans)

### FIXED CODE ###

import math
def cmb(n, r):
  n_ = math.factorial(n)
  n_r_ = math.factorial(n-r) 
  r_ = math.factorial(r)
  return n_//(r_*n_r_)

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

for i in range(1, k+1):
  if n-k+1 >= i:
    ans =  cmb(n-k+1,i)*cmb(k-1,i-1)%(10**9+7)
  else:
    ans = 0
  print(ans)
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for i in range(N):
  if V[i]-C[i] >0:
    ans+=V[i]-C[i]
print(ans)


### FIXED CODE ###

A,B,T=map(int,input().split())
print(int(B*((T+0.5)//A)))
N = int(input())
L = map(int, input().split())

L.sort(key=lambda x:-x)

if L[0] >= sum(L[1::]):
  print('No')
else:
  print('Yes')

### FIXED CODE ###

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

L.sort(key=lambda x:-x)

if L[0] >= sum(L[1::]):
  print('No')
else:
  print('Yes')
n,q = map(int, input().split())
A = [None] * n
for i in range(q):
 c,x,y = map(int,input().split())
 if c == 0:
  A[x] = y
 else:
  a = min(A[x:y+1])
  if a is None: a = "2147483647"
  else: a = str(a)
  print(a)

### FIXED CODE ###

import math, sys
MAX = pow(2, 31) - 1

#??°????????????????????§????°????????????¨???????????°??????????????????????§????
class SegmentTree():
    def __init__(self, n):
        self.TreeRange = pow(2, math.ceil(math.log2(n)))
        self.List = [MAX] * (2 * self.TreeRange - 1)

    def update(self, i, x):
        i += self.TreeRange - 1
        self.List[i] = x
        while i > 0:
            i = (i - 1) // 2
            self.List[i] = min (self.List[i * 2 + 1], self.List[i * 2 + 2])

    def find(self, s, t, i=0, left=0, right=float("inf")):
        #??¢?´¢????±?????????????????????§????????°?????§???????????????
        if right <= s or t <= left:
            return MAX
        #??¢?´¢????±?????????????????????§????????°??????????????????????????????
        elif s <= left <= right <= t:
            return self.List[i]
        #??¢?´¢????±????????????????????????????????????°????????????????????°
        else:
            l = self.find(s, t, i * 2 + 1, left, (left + right) // 2)
            r = self.find(s, t, i * 2 + 2, (left + right) // 2, right)
            return min(l, r)

_input = sys.stdin.readlines()
n,q = map(int, _input[0].split())
qlist = map(lambda x:x.split(), _input[1:])
ST = SegmentTree(n)

for q in qlist:
    cmd, x, y = map(int, q)
    if cmd == 0:
        ST.update(x, y)
    elif cmd == 1:
        print(ST.find(x,y + 1, right = ST.TreeRange))
N = int(input())
num = [0]*N
for i in range(1,10**2 + 1):
    for j in range(1,10**2 + 1):
        for k in range(1,10**2 + 1):
            ans = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if ans <= N:
                num[ans] += 1
for i in range(N):
    print(num[i])


### FIXED CODE ###

N = int(input())
num = [0]*N
for i in range(1,10**2 + 1):
    for j in range(1,10**2 + 1):
        for k in range(1,10**2 + 1):
            ans = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if ans <= N:
                num[ans - 1] += 1
for i in range(N):
    print(num[i])
s = input()
total = 0
for i in product('01', repeat=len(s)-1):
    buf = s[0]
    for j in range(len(s)-1):
        if i[j] == '1':
            total += int(buf)
            buf = s[j+1]
        else:
            buf += s[j+1]
    total += int(buf)
print(total)

### FIXED CODE ###

s = input()
total = 0
n = 2**(len(s)-1)
for i in range(n):
    buf = s[0]
    for j in range(len(s)-1):
        if (i>>j)&1:
            total += int(buf)
            buf = s[j+1]
        else:
            buf += s[j+1]
    total += int(buf)
print(total)