Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
def check(z, zz, z_list, dire):
  zz += z_list[0] * dire
  if len(z_list) == 1:
    if z == zz:
      return 1
    else:
      return 0
  else:
    if check(z, zz, z_list[1:], 1) == 0:
      if check(z, zz, z_list[1:], -1) == 0:
      	return 0
    return 1

    
def func(x, y, xx, yy, x_list, y_list):
  if len(x_list) == 0:
    if x != xx:
      return 0
  else:
    if check(x, xx, x_list, 1) == 0:
      if check(x, xx, x_list, -1) == 0:
      	return 0
  if len(y_list) == 0:
    if y != yy:
      return 0
  else:
    if check(y, yy, y_list, 1) == 0:
      if check(y, yy, y_list, -1) == 0:
      	return 0
  return 1

s = input()
x, y = map(int, input().split())
data = s.split("T")
xx, yy = 0, 0
i = 0
x_list = []
y_list = []
for Fs in data:
  if len(Fs) == 0:
    i += 1
  else:
    if i == 0:
      xx = len(Fs)
    elif i % 2 == 0:
      x_list.append(len(Fs))
    else:
      y_list.append(len(Fs))
    i += 1
if func(x, y, xx, yy, x_list, y_list) == 1:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

# -*- coding: utf-8 -*-
def check(z, zz, z_list):
  if len(z_list) == 0:
    if z != zz:
      return 0
    else:
      return 1
  else:
    z_n = len(z_list)
    z_hash = {}
    z_hash[0] = {}
    z_hash[0][zz] = 1
    z_hash[z_n] = {}
    z_hash[z_n][z] = 1
    for i in range(0,z_n):
      if i+1 not in z_hash:
        z_hash[i+1] = {}
        for b_z in z_hash[i]:
          a_z = b_z + z_list[i]
          z_hash[i+1][a_z] = 1
          a_z = b_z - z_list[i]
          z_hash[i+1][a_z] = 1
      else:
        for b_z in z_hash[i]:
          a_z = b_z + z_list[i]
          if a_z in z_hash[i+1]:
            return 1
          a_z = b_z - z_list[i]
          if a_z in z_hash[i+1]:
            return 1
        return 0
      if z_n-i-1 not in z_hash:
        z_hash[z_n-i-1] = {}
        for a_z in z_hash[z_n-i]:
          b_z = a_z + z_list[z_n-i-1]
          z_hash[z_n-i-1][b_z] = 1
          b_z = a_z - z_list[z_n-i-1]
          z_hash[z_n-i-1][b_z] = 1
      else:
        for a_z in z_hash[z_n-i]:
          b_z = a_z + z_list[z_n-i-1]
          if b_z in z_hash[z_n-i-1]:
            return 1
          b_z = a_z - z_list[z_n-i-1]
          if b_z in z_hash[z_n-i-1]:
            return 1
        return 0



s = input()
x, y = map(int, input().split())
data = s.split("T")
xx, yy = 0, 0
i = 0
x_list = []
y_list = []
for Fs in data:
  if len(Fs) == 0:
    i += 1
  else:
    if i == 0:
      xx = len(Fs)
    elif i % 2 == 0:
      x_list.append(len(Fs))
    else:
      y_list.append(len(Fs))
    i += 1
if check(x, xx, x_list) == 1 and check(y, yy, y_list) == 1:
  print("Yes")
else:
  print("No")
n, m = map(int, input().split())
a, b = [0] * n, [0] * m
for i in range(n):
    a[i] = list(input())
for i in range(m):
    b[i] = list(input())

for sx in range(n-1):
    for sy in range(n-1):
        chk = True
        for tx in range(m):
            for ty in range(m):
                if a[sx+tx][sy+ty] == b[tx][ty]:
                    pass
                else:
                    chk = False
                    break
        if chk:
            print('Yes')
            exit()
print('No')


### FIXED CODE ###

n, m = map(int, input().split())
a, b = [0] * n, [0] * m
for i in range(n):
    a[i] = list(input())
for i in range(m):
    b[i] = list(input())

if n == 1:
    if a[0] == b[0]:
        print('Yes')
    else:
        print('No')
    exit()

for sx in range(n-m):
    for sy in range(n-m):
        chk = True
        for tx in range(m):
            for ty in range(m):
                #print(sx+tx, sy+ty)
                if a[sx+tx][sy+ty] == b[tx][ty]:
                    pass
                else:
                    chk = False
        if chk:
            print('Yes')
            exit()
print('No')
from collections import defaultdict
adj = defaultdict(list)
col = defaultdict(int)
mx=0
edges = {}
def find_color(u , p):
	global mx , now
	cnt =0
	for i in adj[u]:
		cnt = cnt+1
		if i==p:
			continue
		find_color(i , u)
	mx = max(mx, cnt)
now =0
def dfs(u , p):
	global mx, now
	for i in adj[u]:
		if i==p:
			continue
		col[edges[i,u]]=now
		now =(now+1)%mx
	for i in adj[u]:
		if i==p:
			continue
		dfs(i , u)

def main():
	n = int(input())
	for i in range(n-1):
		x, y = map(int , input().split())
		adj[x].append((y))
		adj[y].append((x))
		edges[x,y]=i
		edges[y,x]=i
	find_color(1, 0)
	dfs(1, 0)
	print(mx)
	for i in range(n-1):
		print(col[i]+1)


if __name__ == "__main__":
	main()

### FIXED CODE ###

import os
import sys
from collections import defaultdict
adj = defaultdict(list)
col = defaultdict(int)
sys.setrecursionlimit(1000000)
mx=0
edges = {}
def find_color(u , p):
	global mx , now
	cnt =0
	for i in adj[u]:
		cnt = cnt+1
		if i==p:
			continue
		find_color(i , u)
	mx = max(mx, cnt)
now =0
def dfs(u , p, prev):
	global mx, now
	for i in adj[u]:
		if i==p:
			continue
		if now == prev:
			now = (now+1)%mx
		col[edges[i,u]]=now
		now =(now+1)%mx
	for i in adj[u]:
		if i==p:
			continue
		dfs(i , u, col[edges[i, u]])

def main():
	n = int(input())
	for i in range(n-1):
		x, y = map(int , input().split())
		adj[x].append((y))
		adj[y].append((x))
		edges[x,y]=i
		edges[y,x]=i
	find_color(1, 0)
	dfs(1, 0,-1)
	print(mx)
	for i in range(n-1):
		print(col[i]+1)


if __name__ == "__main__":
	main()
a,b=input().split();print(eval(a/b+a%b))

### FIXED CODE ###

a=eval(input().replace(' ', '+'));print(a//2+a%2)
D,N=map(int,input()split())

if N<100:
  print(pow(100,D)*N)
else:
  print(pow(100,D)*101)


### FIXED CODE ###

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

if N<100:
  print(100**D*N)
else:
  print(100**D*101)
N = int(input())
number = []
    for A in range(1,10):
    for B in range(1,10):
      number.append(A*B)
if N in number :
  print("Yes")
else :
  print("No")

### FIXED CODE ###

N = int(input())
number = []
for a in range(1,10):
    for b in range(1,10):
        number.append(b*a)
if N in number :
    print("Yes")
else :
    print("No")
s,w = map(int,input())
if s < w:
  print('unsafe')
else:
  print('safe')

### FIXED CODE ###

s,w = map(int,input().split())
if s <= w:
  print('unsafe')
else:
  print('safe')
n = int(input())
s = input()

ans = 'Yes'

for i in (n // 2):
    if s[i] != s[i + (n // 2)]:
        ans = 'No'

print(ans)
        
        


### FIXED CODE ###

n = int(input())
s = input()

ans = 'Yes'

if n % 2 != 0:
    ans = 'No'
    
for i in range(n // 2):
    if s[i] != s[i + (n // 2)]:
        ans = 'No'

print(ans)
N, M = (int(i) for i in input().split())  
X = [int(i) for i in input().split()] 
lg_bw_x = [] 
s= 0
if N >= M:
    print(0)
else
    X.sort()
    for i in range(M-1):
        lg_bw_x.append(X[i+1] - X[i])
    lg_bw_x.sort()
    for j in range(M-N-1):
        s = s+lg_bw_x[j]
    print(s)


### FIXED CODE ###

T, X = (int(i) for i in input().split())  
print(T / X)
a = int(input()
print(a + a**2 + a**3)

### FIXED CODE ###

a = int(input())
print(a + a**2 + a**3)
r = int(input())
print(2*math.pi*r)

### FIXED CODE ###

import math
r = int(input())
print(2*math.pi*r)
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = [int(i) for i in input().split()]

last = dict()
v = [-1] * N

for i, a in enumerate(A + A) :
    if a in last and last[a] < N :
        v[last[a]] = i + 1
    
    last[a] = i

dist = [-1] * N
cur = 0
cycle = 0
while dist[cur] < 0 :
    dist[cur] = cycle 
    cycle += v[cur] - cur
    cur = v[cur] % N

NK = N * K

m = NK % cycle
cur = v[cur] % N
s = 0
while m > dist[cur] > 0 :
    s = dist[cur]
    cur = v[cur] % N
m -= s

ret = []
seen = set()
for a in A[N-m:] :
    if a in seen :
        p = ret.pop()
        while p != a :
            seen.remove(p)
            p = ret.pop()
    else :
        ret.append(a)
        seen.add(a)
        
print(' '.join([str(i) for i in ret]))

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = [int(i) for i in input().split()]

last = dict()
v = [-1] * N

for i, a in enumerate(A + A) :
    if a in last and last[a] < N :
        v[last[a]] = i + 1
    
    last[a] = i

dist = [-1] * N
cur = 0
cycle = 0
while dist[cur] < 0 :
    dist[cur] = cycle 
    cycle += v[cur] - cur
    cur = v[cur] % N

NK = N * K

m = NK % cycle
cur = v[cur] % N
s = 0
while m > dist[cur] > 0 :
    s = dist[cur]
    cur = v[cur] % N
m -= s

ret = []
seen = set()
for a in A[N-m:] :
    if a in seen :
        p = ret.pop()
        seen.remove(a)
        while p != a :
            seen.remove(p)
            p = ret.pop()
    else :
        ret.append(a)
        seen.add(a)
        
print(' '.join([str(i) for i in ret]))
from decimal import Decimal
import math
a , b, h , m = map(int , input().split())
angh = (h/12)*360 + (m/60)*30
angm = (m/60)*360
#print("h , m ",angh,angm)
ang = abs(angh-angm)
ang = min(360-ang,ang)
#print("ang :",ang)
#if ang == 180: print(0); exit()
if ang == 0: print(0); exit()
print("{:.50f}".format(Decimal((a*a + b*b - 2*a*b*math.cos(Decimal(math.radians(ang)))).sqrt())))



### FIXED CODE ###

from decimal import Decimal
import math
a , b, h , m = map(int , input().split())
angh = (h/12)*360 + (m/60)*30
angm = (m/60)*360
#print("h , m ",angh,angm)
ang = abs(angh-angm)
#ang = min(360-ang,ang)
#print("ang :",ang)
#if ang == 180: print(0); exit()
#if ang == 0: print(0); exit()
val = a*a + b*b - 2*a*b*math.cos(math.radians(ang))
print(val**0.5)
a,b = map(int, raw_input().split())
if a > b:
   print "a > b"
elif a < b:
   print "a < b"
else
   print "a == b"
end

### FIXED CODE ###

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

if a > b:
    print "a > b"
elif a < b:
    print "a < b"
else:
    print "a == b"
def main():
    n = int(input())
    h = list(map(int, input().split(' ')))
    print('Yes' if check(h, 0) else 'No')


def check(l, m):
    if len(l) <= 1:
        return True
    elif m:
        if len(l) == 2:
            return True if l[0] - l[1] <= 0 else False
        else:
            return check(l[1::], 0) if l[0] - l[1] <= 0 else False
    else:
        if l[0] - l[1] >= 2:
            return False
        elif l[0] - l[1] == 1:
            return check(l[1::], 1)
        else:
            return check(l[1::], 0)
            


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    h = list(map(int, input().split(' ')))

    ans = True
    MAX = h[0]
    for i in range(n):
        if h[i] > MAX:
            MAX = h[i]
        elif h[i] < MAX - 1:
            ans = False
        else:
            continue
        
    print('Yes' if ans else 'No')


if __name__ == '__main__':
    main()
r, c = map(int, input().split())
table = []
for i in range(r):
    table.append(list(map(int, input().split())))
for i in table:
    i.append(sum(i))
b = []
for i in range(c):
    b.append(sum(list(table[i][k for k in range(r)])))
b.append(sum(b))
for i in table:
    print(" ".join(map(str, i)))
print(" ".join(map(str, b)))


### FIXED CODE ###

r, c = map(int, input().split())
table = []
for i in range(r):
    table.append(list(map(int, input().split())))
for i in table:
    i.append(sum(i))
b = []
for i in range(c):
    x = 0
    for k in range(r):
        x += table[k][i]
    b.append(x)
b.append(sum(b))
for i in table:
    print(" ".join(map(str, i)))
print(" ".join(map(str, b)))
a = input()
s = 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 = int(input())
table = [[-1]*(N+1) for i in range(N+1)]
for i in range(1,N+1):
    A = int(input())
    for j in range(A):
        x,y = map(int,input().split())
        table[i][x] = y
#print(table)
# table[i][x] 人iが人xを正直者;1,真偽不明:0,未言及:-1

ans = 0
for i in range(2**N):

    # hito = [0]*N
    # for j in range(N):
    #     if i >> j & 1:
    #         hito[j] = 1
    # print(hito)

    flag = True
    cnt = 0
    for j in range(N):
        if i >> j & 1:
            cnt += 1
            for k in range(N):
                if table[j+1][k+1] != -1:
                    #print(table[j+1][k+1])


                    if k == 0:
                    if table[j+1][k+1] ^ (i >> k):
                        # if j == 1 and k == 0:
                        #     print(i>>k)
                        #     print(table[j+1][k+1])
                        flag = False
                        #print(i,j,k)
    if flag:
        if cnt > ans:
            ans = cnt
print(ans)
# print(3 >> 0) # 3????
# print(1^3)



### FIXED CODE ###

N = int(input())
table = [[-1]*(N) for i in range(N)]
for i in range(N):
    A = int(input())
    for j in range(A):
        x,y = map(int,input().split())
        table[i][x-1] = y
# print(table)
# table[i][x] 人iが人xを正直者;1,真偽不明:0,未言及:-1

ans = 0
for i in range(2**N):

    hito = [0]*N
    for j in range(N):
        if i >> j & 1:
            hito[j] = 1

    flag = True
    cnt = 0
    for j in range(N):
        if i >> j & 1:
            cnt += 1
            for k in range(N):
                if table[j][k] != -1:
                    if table[j][k] != hito[k]:
                        flag = False
    if flag:
        if cnt > ans:
            ans = cnt
print(ans)
#print(3 >> 0) # 3????
MOD = 10**9 + 7
N = int(input())
C = []
last_idx = [0 for i in range(200000)]
bef = [0 for i in range(N+1)]
for i in range(1,N+1):
	c = int(input())
	C.append(c)
	bef[i] = last_idx[c]
	last_idx[c] = i
dp = [0 for i in range(N+1)]
dp[1] = 1
if N == 1 or N == 2:
	print(1)
	exit()

for i in range(2, N+1):
	if bef[i] < i-1:
		dp[i] = (dp[i-1] + dp[bef[i]]) % MOD
	else:
		dp[i] = dp[i-1]
print(dp[N])

### FIXED CODE ###

MOD = 10**9 + 7
N = int(input())
C = []
last_idx = [0 for i in range(200001)]
bef = [0 for i in range(N+1)]
for i in range(1,N+1):
	c = int(input())
	C.append(c)
	bef[i] = last_idx[c]
	last_idx[c] = i
dp = [0 for i in range(N+1)]
dp[1] = 1
if N == 1 or N == 2:
	print(1)
	exit()

for i in range(2, N+1):
	if bef[i] < i-1:
		dp[i] = (dp[i-1] + dp[bef[i]]) % MOD
	else:
		dp[i] = dp[i-1]
print(dp[N])
from collections import Counter as c
from scipy.misc import comb
from functools import reduce

def f(n):
  d=c()
  for i in range(2,1+int(n**0.5)):
    while n%i==0:
      d[i]+=1
      n//=i
  if n:d[n]+=1
  return d.values()

n,m=map(int,input().split())
mod=10**9+7
print(reduce(lambda x,y:x*y%mod,map(lambda x:comb(x+n-1,x,exact=True),f(m)))%mod)


### FIXED CODE ###

*l,=map(int,input().split())
l.sort()
print(l[2]*10+l[1]+l[0])
n = int(raw_input())
ls = []
for i in range(n):
    cmd = map(str, raw_input().split())
    if cmd[0] == "insert":
        ls.append(cmd[1])
    elif cmd[0] == "deleteFirst":
        del ls[len(ls)-1:]
    elif cmd[0] == "deleteLast":
        del ls[1:]
    else:
        for i in range(len(ls)-1,0,-1):
            if ls[i] == cmd[1]:
            a = ls.pop(i)
print " ".join(map(str, ls[::-1]))

### FIXED CODE ###

n = int(raw_input())
ls = []
bp = 0
for i in range(n):
	cmd = raw_input()
	if cmd[0] == "i":
		ls.append(cmd[7:])
	elif cmd[6] == " ":
		try:
			x = ls[::-1].index(cmd[7:])
			if x!=-1:
				del ls[-x-1]
		except:
			pass
	elif cmd[6] == "F":
		ls.pop()
	else:
		bp += 1

print " ".join(map(str, ls[bp:][::-1]))
n,k,q=map(int,input().split())
a=[int(input())-1 for i in range(q)]
b=[0]*n


for i in range(q):
  b[a[i]]+=1

for i in range(n):
  if k-n+b[i]>0:
    print("Yes")
  else
    print("No")


### FIXED CODE ###

n,k,q=map(int,input().split())
a=[int(input())-1 for i in range(q)]
b=[0]*n


for i in range(q):
  b[a[i]]+=1

for i in range(n):
  if k-q+b[i]>0:
    print("Yes")
  else:
    print("No")
o=input()
a=list(map(int,input().split()))
print(max(a)-min(a))


### FIXED CODE ###

_=int(input())
print(_<<(_&1))
n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if ord(t[0]) > ord(h[0]):
        st += 3
    elif ord(t[0]) < ord(h[0]):
        sh += 3
    else:
        m = h if len(t) > len(h) else t
        l = 1
        for j in range(m):
            if ord(t[j]) > ord(h[j]):
                st += 3
                j = m
                l = 0
            else:
                sh += 3
                j = m
                l = 0
        if l:
            st += 1
            sh += 1
print(st, sh)

### FIXED CODE ###

n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if t > h:
        st += 3
    elif t < h:
        sh += 3
    else:
        st += 1
        sh += 1
print(st, sh)
itos = ["A", "B", "C"]

def swap(ABC, f, t):
    ABC[f] -= 1
    ABC[t] += 1
    return itos[t]


def main():
    N, A, B, C = map(int, input().split())
    S = [input() for i in range(N)]
    ABC = [A, B, C]
    StoP = {"AB": (0, 1), "BC": (1, 2), "AC": (0, 2)}
    itos = ["A", "B", "C"]
    L = []
    for i in range(N):
        x, y = StoP[S[i]]

        if ABC[x] == 0 and ABC[y] == 0:
            print("No")
            return
        if ABC[x] == 1 and ABC[y] == 1 and i < N - 1 and S[i] != S[i+1]:
            x2, y2 = StoP(S[i+1])
            if x in [x2, y2]:
                L.append(swap(ABC, y, x))
            else:
                L.append(swap(ABC, x, y))
        elif ABC[x] < ABC[y]:
            L.append(swap(ABC, y, x))
        else:
            L.append(swap(ABC, x, y))

    print("Yes")
    print(*L, sep='\n')
if __name__ == '__main__':
    main()

### FIXED CODE ###


itos = ["A", "B", "C"]

def swap(ABC, f, t):
    ABC[f] -= 1
    ABC[t] += 1
    return itos[t]


def main():
    N, A, B, C = map(int, input().split())
    S = [input() for i in range(N)]
    ABC = [A, B, C]
    StoP = {"AB": (0, 1), "BC": (1, 2), "AC": (0, 2)}
    itos = ["A", "B", "C"]
    L = []
    for i in range(N):
        x, y = StoP[S[i]]

        if ABC[x] == 0 and ABC[y] == 0:
            print("No")
            return
        if ABC[x] == 1 and ABC[y] == 1 and i < N - 1 and S[i] != S[i+1]:
            x2, y2 = StoP[S[i+1]]
            if x in [x2, y2]:
                L.append(swap(ABC, y, x))
            else:
                L.append(swap(ABC, x, y))
        elif ABC[x] < ABC[y]:
            L.append(swap(ABC, y, x))
        else:
            L.append(swap(ABC, x, y))

    print("Yes")
    print(*L, sep='\n')
if __name__ == '__main__':
    main()
import re
isHitachi = re.search("(hi)+")
if isHitachi:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import re
s = input()
isHitachi = re.search("^(hi)+$", s)
if isHitachi:
  print("Yes")
else:
  print("No")
import math

A, B, C, D = map(int, input().split())

start = A // C
end = B // C
if A % C != 0:
    start = start + 1
C_num = end - start + 1

start = A // D
end = B // D
if A % D != 0:
    start = start + 1
D_num = end - start + 1

CD = C * D // math.gcd(C, D)
start = A // CD
end = B // CD
if A % CD != 0:
    start = start + 1
CD_num = end - start + 1

ans = (B - A + 1) - (C_num + D_num - CD_num)

print(ans)


### FIXED CODE ###

def gcd(a, b): # a < b
    while True:
        c = b%a
        if c == 0:
            break
        b = a
        a = c

    return a


A, B, C, D = map(int, input().split())

start = A // C
end = B // C
if A % C != 0:
    start = start + 1
C_num = end - start + 1

start = A // D
end = B // D
if A % D != 0:
    start = start + 1
D_num = end - start + 1

CD = C * D // gcd(C, D)
start = A // CD
end = B // CD
if A % CD != 0:
    start = start + 1
CD_num = end - start + 1

ans = (B - A + 1) - (C_num + D_num - CD_num)

print(ans)
a,b = map(int,input().split())
n =　b-a
print(n*(n+1)/2-b)


### FIXED CODE ###

a,b = map(int,input().split())
n = b-a
tower = ((n+1)*n)/2
print(int(tower-b))
n = int(input())
l = [int(x) for x in input().split()]

for i in range(n):
    a = l[i]
    j = i - 1

    while j >= 0 and l[j] > a:
        l[j+1] = l[j]
        j = j - 1

    l[j + 1] = a
    print(*1)

### FIXED CODE ###

import string
n = int(input())
l = []
l = list(map(int, input().split()))
for i in range(n):
    key = l[i]
    j = i -1
    while j >= 0 and l[j] > key:
        l[j + 1] = l[j]
        j -= 1
    l[j + 1] = key
    print(' '.join(map(str, l)))
import sys
C = [list(map(int, sys.stdin.readline().split(" "))) for i in range(3)]
for a0 in range(101):
    b1 = C[0][0] - a0
    b2 = C[0][1] - a0
    b3 = C[0][2] - a0
    if (C[1][0] - b0 == C[1][1] - b1 == C[1][2] - b2) and (C[2][0] - b0 == C[2][1] - b1 == C[2][2] - b2):
        print("Yes")
        exit()
print("No")

### FIXED CODE ###

import sys
C = [list(map(int, sys.stdin.readline().split(" "))) for i in range(3)]
for a0 in range(101):
    b0 = C[0][0] - a0
    b1 = C[0][1] - a0
    b2 = C[0][2] - a0
    if (C[1][0] - b0 == C[1][1] - b1 == C[1][2] - b2) and (C[2][0] - b0 == C[2][1] - b1 == C[2][2] - b2):
        print("Yes")
        exit()
print("No")
D = 3 * (r**2)

### FIXED CODE ###

r = int(input())
D = 3 * (r**2)
print(D)
N = int(input())
L = list(map(int, input(.split())))
ind = L.index(max(L))
if sum(L[ind-1:])+sum(L[:ind+1]) < max(L)
    print('Yes')
else:      
    print('No')

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
if max(l) < sum(l) - max(l):
    print('Yes')
else:
    print('No')
a,b=int(input())
print(a*b/2)

### FIXED CODE ###

a,b,c=map(int,input().split())
print(a*b//2)
n = int(input())
i = 1
j = 1
ans = 0
for i in range(9):
#  ans 
  for j in range(9):
    if i * j == n:
      ans = 1
if ans == 1:
  print("Yes")1
else:
  print("No")

### FIXED CODE ###

n = int(input())
i = 1
j = 1
ans = 0
for i in range(10):
#  ans 
  for j in range(10):
    if i * j == n:
      ans = 1
if ans == 1:
  print("Yes")
else:
  print("No")
X = int(input())
L = []
ANS = []
for i in range(1,33) :
    for j in range(2,11) :
        if i**j <= 1000 :
            l = i**j
            L.append(l)
L = list(set(L))
L = sorted(L)
for j in range(len(L)) :
    if L[j] <= X < L[j+1] :
        ans = L[j]
        ANS.append(ans)
print(max(ANS))



### FIXED CODE ###

X = int(input())
L = []
ANS = []
for i in range(1,33) :
    for j in range(2,11) :
        if i**j <= 1192 :
            l = i**j
            L.append(l)
L = list(set(L))
L = sorted(L)
for j in range(len(L)) :
    if L[j] <= X < L[j+1] :
        ans = L[j]
        ANS.append(ans)
print(max(ANS))
A,B,X = list(map(int,input().split()))

for i in reversed(range(len(str(A)))):
    num = int("1"+"0"*i)-1
    for N in reversed(range(num)):
        if X > A*N+B*i:
            print(A*N+B*i)

### FIXED CODE ###

a = ["SUN","MON","TUE","WED","THU","FRI","SAT"][::-1]
S = input()
print(a.index(S)+1)
l = map(int, input().split())
k = int(input())
l = sorted(l, reversed=True)
for i in range(k):
  l[0] = l[0]*2
print(sum(l))

### FIXED CODE ###

l = list(map(int, input().split()))
k = int(input())
l = sorted(l, reverse=True)
for i in range(k):
  l[0] = l[0]*2
print(sum(l))
K,X= map(int,input().split())

if 500*X >= X:
  print("Yes")
 else:
  print("No")

### FIXED CODE ###

K,X= map(int,input().split())

if 500*K >= X:
  print("Yes")
else:
  print("No")
N, A, B = map(int, input().split())

Que = []
while len(Que) < N:
    Que = Que + [1]*A
    Que = Que + [0]*B
Que[0:N].count(1)

### FIXED CODE ###

n, a, b = map(int, input().split())
print(n//(a+b)*a + min([n%(a+b), a]))
A, B, C = map(int, input().split())
K= int(input()) 
 
 
if (B**K>A)&(C>B):
  print("Yes")
elif (B**(K-1)>A)&(C>B**1) :
  print("Yes")
elif (B**(K-2)>A)&(C>B**2) :
  print("Yes")
elif (B**(K-3)>A)&(C>B**3) :
  print("Yes")
elif (B**(K-4)>A)&(C>B**4) :
  print("Yes")
elif (B**(K-5)>A)&(C>B**5) :
  print("Yes")
elif (B**(K-6)>A)&(C>B**6) :
  print("Yes")
elif (B**(K-7)>A)&(C>B**7) :
  print("Yes")
else :
  print("No")

### FIXED CODE ###

s = int(input()) 
 
if 400 <= s <= 599:
  print("8")
elif  600 <= s <=799:
        print("7")
elif  800 <= s <=999:
        print("6")
elif  1000 <= s <=1199:
        print("5")
elif  1200 <= s <=1399:
        print("4")
elif  1400 <= s <=1599:
        print("3")
elif  1600 <= s <=1799:
        print("2")
elif  1800 <= s <=1999:
        print("1")
a = [int(input()) for _ in range(5)]
delta = []
time = 0

for i in range(5):
    a10 = 0
    if str(a[i])[-1] != '0':
        a10 = (10 - int(str(a[i])[-1]))
        delta.append(a10)
    time += a[i] + a10


print(time-max(delta))


### FIXED CODE ###

a = [int(input()) for _ in range(5)]
delta = []
time = 0
count = 0

for i in range(5):
    a10 = 0
    if str(a[i])[-1] != '0':
        a10 = (10 - int(str(a[i])[-1]))
        delta.append(a10)
        count += 0
    time += a[i] + a10

if count == 0:
    delta.append(0)

print(time-max(delta))