Harryxun/stf_run huggingface dataset:
from math import gcd
a,b,c,d=map(int,input().split( ))
r1=b-b%c
if a%c!=0:
	l1=a-a%c+c
else:
	l1=a
r2=b-b%d
if a%d!=0:
	l2=a-a%d+d
else:
	l2=a
lcm=(c*d)//gcd(c,d)
r3=b-b%lcm
if a%lcm!=0:
	l3=a-a%lcm+lcm
else:
	l3=a
nc=(r1-l1+c)//c
nd=(r2-l2+d)//d
nlcm=(r3-l3+lcm)//lcm
divi=nc+nd-nlcm
out=b-a+1
print(out-divi)




### FIXED CODE ###

from fractions import gcd
a,b,c,d=map(int,input().split(' '))
r1=b-b%c
if a%c!=0:
	l1=a-a%c+c
else:
	l1=a
r2=b-b%d
if a%d!=0:
	l2=a-a%d+d
else:
	l2=a
lcm=(c*d)//gcd(c,d)
r3=b-b%lcm
if a%lcm!=0:
	l3=a-a%lcm+lcm
else:
	l3=a
nc=(r1-l1+c)//c
nd=(r2-l2+d)//d
nlcm=(r3-l3+lcm)//lcm
divi=nc+nd-nlcm
out=b-a+1
if c>a and c>b and d>a and d>b:
	print(0)
else:
	print(out-divi)
n, m  = map(int, input().split())
g     = {}
used  = {i:[False for _ in range(11)] for i in range(n)}
color     = [0  for _ in range(n)]
 
for _ in range(m):
    u, v = map(int, input().split())
    u-=1
    v-=1
    if u not in g:
        g[u] = []
    if v not in g:
        g[v] = []
    g[u].append(v)
    g[v].append(u)
    
q = int(input())
Q = []
 
for _ in range(q):
    node, dis, col = map(int, input().split())
    Q.append([node-1, dis, col])
Q = Q[::-1]
 
def bfs(now, dist, col):
    if dist < 0:
        return
    
    if used[now][dist]:
        return
 
    used[now][dist] = True
    
    if not color[now]:
        color[now] = col
 
	if now in g:
    	for x in g[now]:
        	bfs(x, dist - 1, col)
            
for node, dis, col in Q:
    bfs(node, dis, col)

for x in color:
    print(x)

### FIXED CODE ###

n, m  = map(int, input().split())
g     = {}
used  = {i:[False for _ in range(11)] for i in range(n)}
color     = [0  for _ in range(n)]

for _ in range(m):
    u, v = map(int, input().split())
    u-=1
    v-=1
    if u not in g:
        g[u] = []
    if v not in g:
        g[v] = []
    g[u].append(v)
    g[v].append(u)
    
q = int(input())
Q = []

for _ in range(q):
    node, dis, col = map(int, input().split())
    Q.append([node-1, dis, col])
Q = Q[::-1]

def bfs(now, dist, col):
    if dist < 0:
        return
    
    if used[now][dist]:
        return
 
    used[now][dist] = True
    
    if not color[now]:
        color[now] = col
 
    if now in g:
        for x in g[now]:
            bfs(x, dist - 1, col)
            
for node, dis, col in Q:
    bfs(node, dis, col)

for x in color:
    print(x)
s=list(int(input()))
#sのi番目までの合計をsumとする
def dfs(i,sum):
  if i==4:
    return sum==7
  if dfs(i+1,sum+s[i]):
    return True
  if dfs(i+1,sum-s[i]):
    return True
  else:
    return False
if dfs(0,s[0]):
  print("Yes")
else:
  print("No")

    

### FIXED CODE ###

s=list(input())
#sのi番目の次に＋かーを入れる。それまでの文字列char,合計sum
def dfs(i,char,sum):
  if i==3:
    if sum==7:
      print(char+"=7")
      exit()
  else:
    dfs(i+1,char+"+"+s[i+1],sum+int(s[i+1]))  
    dfs(i+1,char+"-"+s[i+1],sum-int(s[i+1]))
        
    
      
    
      
dfs(0,s[0],int(s[0]))
#FT robot
s=input()
gx,gy=map(int,input().split())
lists=list(s.split("T"))
xlist=[]
ylist=[]
if s[0]=="T":
    for i in range(len(lists)):
        if i%2==0:
            xlist.append(len(lists[i]))
        else:
            ylist.append(len(lists[i]))
elif s[0]=="F":
    for i in range(len(lists)):
        if i%2==0:
            xlist.append(len(lists[i]))
        else:
            ylist.append(len(lists[i]))
    gx-=xlist[0]
    del xlist[0]
Xsum=sum(xlist)
Ysum=sum(ylist)


if (Xsum+gx)%2!=0 or (Ysum+gy)%2!=0:
    print("No")   
else:
    gx1=(Xsum+gx)//2
    gx2=(Xsum-gx)//2
    gy1=(Ysum+gy)//2
    gy2=(Ysum-gy)//2
    dpx=[[False for i in range(Xsum+2)] for j in range(len(xlist)+2)]
    dpy=[[False for i in range(Ysum+2)] for j in range(len(ylist)+2)]
    #dpx[i][j]でi番目のカードまでを足して、値ｊを取れるか判定する
    dpx[0][0]=True
    dpy[0][0]=True
    for i in range(len(xlist)):
        for j in range(Xsum+2):
            dpx[i+1][j]=dpx[i][j-xlist[i]] or dpx[i][j]
    for i in range(len(ylist)):
        for j in range(Ysum+2):
            dpy[i+1][j]=dpy[i][j-ylist[i]] or dpy[i][j]    
    #ここまではあってそうなことがわかった
    if 　 ((0<=gy1<= Ysum   and dpy[len(ylist)][gy1]) or ((0<=gy2<= Ysum   and  dpy[len(ylist)][gy2]) :
        if  ((0<=gx1<= Xsum   and dpx[len(xlist)][gx1]) or ((0<=gx2<= Xsum   and  dpx[len(xlist)][gx2]) :
                                                            print("Yes")
    else:
                                                            print("No")
                                                            

### FIXED CODE ###

      #FT robot
s=input()
gx,gy=map(int,input().split())
lists=list(s.split("T"))
xlist=[]
ylist=[]
if s[0]=="T":
    for i in range(len(lists)):
        if i%2==0:
            xlist.append(len(lists[i]))
        else:
            ylist.append(len(lists[i]))
elif s[0]=="F":
    for i in range(len(lists)):
        if i%2==0:
            xlist.append(len(lists[i]))
        else:
            ylist.append(len(lists[i]))
    gx-=xlist[0]
    del xlist[0]
Xsum=sum(xlist)
Ysum=sum(ylist)


if (Xsum+gx)%2!=0 or (Ysum+gy)%2!=0:
    print("No")   
else:
    gx1=(Xsum+gx)//2
    gx2=(Xsum-gx)//2
    gy1=(Ysum+gy)//2
    gy2=(Ysum-gy)//2
    dpx=[[False for i in range(Xsum+2)] for j in range(len(xlist)+2)]
    dpy=[[False for i in range(Ysum+2)] for j in range(len(ylist)+2)]
    #dpx[i][j]でi番目のカードまでを足して、値ｊを取れるか判定する
    dpx[0][0]=True
    dpy[0][0]=True
    for i in range(len(xlist)):
        for j in range(Xsum+2):
            dpx[i+1][j]=dpx[i][j-xlist[i]] or dpx[i][j]
    for i in range(len(ylist)):
        for j in range(Ysum+2):
            dpy[i+1][j]=dpy[i][j-ylist[i]] or dpy[i][j]    
    #ここまではあってそうなことがわかった
    flag1=False
    if 0<= gy1<= Ysum:   
        if dpy[len(ylist)][gy1]:
            flag1=True
    flag2=False
    if 0<=gy2<= Ysum :
        if dpy[len(ylist)][gy2]:
            flag2=True
    flag3=False
    if 0<=gx1<= Xsum:
        if dpx[len(xlist)][gx1]:
            flag3=True
    flag4=False
    if 0<=gx2<= Xsum:
        if dpx[len(xlist)][gx2]:
            flag4=True
    if (flag1 or flag2) and (flag3 or flag4):
        print("Yes")
    else:
        print("No")
a,s,c=map(str(input().split()).capitalize())
print(f'{"A"}{s[0]}{"C"}')


### FIXED CODE ###

a,s,c=input().split()
print(a[0]+s[0]+c[0])
n = int(input())
L = list(map(int,input().split()))

dp = [0]*(2*(10**5)+1000)
one = []
for i in range(n):
    if L.count(L[i]) == 1:
        one.append(L[i])

for i in L:
    for j in range(2*i,max(L)+1,i):
        if not dp[j-1]:
            dp[j-1] = 1

ans = 0
for i in one:
    if dp[i-1] == 0:
        ans +=1
print(ans)


### FIXED CODE ###

n = int(input())
L = list(map(int,input().split()))
dp = [0]*((10**6)+1000)
for i in L:
    dp[i] +=1

one = []
for i in range(10**6+1000):
    if dp[i] == 1:
        one.append(i)

dp = [0]*((10**6)+1000)
a = list(set(L))
for i in a:
    for j in range(2*i,10**6+1000,i):
        dp[j] = 1

ans = 0
for i in one:
    if dp[i] == 0:
        ans +=1
print(ans)
a,b=map(int,input().split())
print('DH'[a==b])

### FIXED CODE ###

a,_,b=input()
print("DH"[a==b])
import heapq

n, q = map(int, input().split())
children = []  # (-レート, 幼稚園番号)
schools = [[] for _ in range(200000)]  # [(-レート, 子供番号)]
strongests = []  # (+レート, 幼稚園番号)

for i in range(n):
    a, b = map(int, input().split())
    b -= 1
    children.append((-a, b))
    schools[b].append((-a, i))

for i, school in enumerate(schools):
    if len(school) > 0:
        heapq.heapify(school)
        strongests.append((-school[0][0], i))
heapq.heapify(strongests)

for _ in range(q):
    c, d = map(int, input().split())
    c -= 1
    d -= 1
    org_school = children[c][1]
    children[c] = (children[c][0], d)

    while True:
        if len(schools[org_school]) == 0:
            break
        if children[schools[org_school][0][1]][1] == org_school:
            break
        else:
            heapq.heappop(schools[org_school])
    if len(schools[org_school]) > 0:
        heapq.heappush(strongests, (-schools[org_school][0][0], org_school))

    heapq.heappush(schools[d], (children[c][0], c))
    heapq.heappush(strongests, (-schools[d][0][0], d))

    while True:
        if len(schools[strongests[0][1]]) == 0 or strongests[0][0] != -schools[strongests[0][1]][0][0]:
            heapq.heappop(strongests)
        else:
            print(strongests[0][0])
            break


### FIXED CODE ###

x = list(map(int, input().split()))
print(x.index(0) + 1)
import sys

S = input()
K = int(input())

s = [v for v in S]

block = []
count = 1

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        count += 1
        if i+2 == len(s):
            block.append(s[i]*count)
    else:
        block.append(s[i]*count)
        count = 1

z = len(block)
t = 0
d = 0

if not z == 1:
    for j in range(len(block)):
        x = len(block[j])
        if x == 1:
            continue
        else:
            if x%2 == 0:
                t += x//2
            elif x%2 == 1:
                t += x - (x+1)//2
    
    if block[0][0] == block[-1][-1]:
        joint = block[0] + block[-1]
        y = len(joint)
        if y%2 == 1:
            d = 0
        elif y%2 == 0:
            d = 1
else:
    p = len(block[0])
    if p%2 == 0:
        t = p//2
    else:
        t = (p-1)//2
        if K%2 == 1:
            ans = t + p*(K-1)//2                       
            print(ans)
            sys.exit()
        else:
            ans = p + p*(K-2)//2
            print(ans)
            sys.exit()

ans = t*K + d*(K-1)
print(ans)

### FIXED CODE ###

S = input()
K = int(input())

s = [v for v in S]

block = []
count = 1

if len(s) == 1:
    if K == 1:
        print(0)
        exit()
    else:
        if K%2 == 1:
            print((K-1)//2)
            exit()
        else:
            print(K//2)
            exit()

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        count += 1
        if i+2 == len(s):
            block.append(s[i]*count)
    else:
        block.append(s[i]*count)
        count = 1

z = len(block)
t = 0
d = 0

if not z == 1:
    for j in range(len(block)):
        x = len(block[j])
        if x == 1:
            continue
        else:
            if x%2 == 0:
                t += x//2
            elif x%2 == 1:
                t += x - (x+1)//2
    
    if block[0][0] == block[-1][-1]:
        joint = block[0] + block[-1]
        y = len(joint)
        if y%2 == 1:
            d = 0
        else:
            d = 1
else:
    p = len(block[0])
    if p%2 == 0:
        t = p//2
    else:
        t = (p-1)//2
        if K%2 == 1:
            ans = t + p*(K-1)//2                       
            print(ans)
            exit()
        else:
            ans = p + p*(K-2)//2
            print(ans)
            exit()

ans = t*K + d*(K-1)
print(ans)
a = int(input())
b = int(input())

c = a * b

if (c % 2 == 0):
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

a,b=list(map(int, input().split()))
 
if a*b%2 == 0:
   print("Even")
else:
   print("Odd")
n = input()
str = input()
val = []
o = str[:1]
if o == 'D':
  n -= 1
  val.append(n)
  str = str[1:]
else:
  n += 1
  val.append(n)
  str = str[1:]
  

### FIXED CODE ###

n = input()
n = int(n)
str = input()
val = [0]
x = 0
for _ in range(n):
  o = str[:1]
  if o == 'D':
    x -= 1
  else:
    x += 1
  val.append(x)
  str = str[1:]
print(max(val))
a,b,c = map(int,input().split())

if(a< b && b < c):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if(a < b and b < c):
    print("Yes")
else:
    print("No")
from copy import deepcopy
from collections import deque
from itertools import product
import numpy as np
inputs = open(0).readlines()
class Grid():
    def __init__(self, grid, w=0, h=0, function=lambda x: x):
        self.w = w = w if w else len(grid[0])
        self.h = h = h if h else len(grid)
        dtype = type(function(grid[0][0]))
        self.grid = np.empty((h, w), dtype=dtype)
        for i, row in zip(range(h), grid):
            for j, val in zip(range(w), row):
                self.grid[i][j] = function(val)
    
    def is_valid_x(self, x):
        return 0 <= x < self.w
    def is_valid_y(self, y):
        return 0 <= y < self.h
    def is_valid_xy(self, x, y):
        return self.is_valid_x(x) and self.is_valid_y(y) 
    
    def __iter__(self):
        return iter(self.grid)
    def __repr__(self):
        return '\n'.join([' '.join(map(str, row)) for row in self.grid])
    def __getitem__(self, x):
        return self.grid[x]
    def __setitem__(self, x, val):
        self.grid[x] = val

h, w = map(int, inputs[0].split())
grid_origin = Grid(inputs[1:], function=lambda x: int(x == '.'))

def bfs(root):
    d = 0
    queue = deque([root])
    grid[root] = 0
    while queue:
        x, y = queue.popleft()
        d += 1
        for dx, dy in zip([1, 0, -1, 0], [0, 1, 0, -1]):
            if grid.is_valid_xy(x+dx, y+dy) and grid[y+dy, x+dx]:
                queue.append((x+dx, y+dy))
                grid[y+dy, x+dx] = 0
    return d-1
    
ans = 0
for i, j in product(range(h), range(w)):
    if grid_origin[i, j]:
        grid = deepcopy(grid_origin)
        ans = max(ans, bfs((j, i)))
print(ans)

### FIXED CODE ###

import sys
from copy import deepcopy
from collections import deque
from itertools import chain

chain_from_iterable = chain.from_iterable
inputs = sys.stdin.readlines()
h, w = map(int, inputs[0].split())
S = [list(map(lambda x: int(x=='.'), x)) for x in inputs[1:]]
S.insert(0, [0]*w)
S.append([0]*w)
for row in S:
    row.insert(0, 0)
    row.append(0)

max_dist = 0
for y in range(1, h+1):
    for x in range(1, w+1):
        if S[y][x] == 0:
            continue
        maze = deepcopy(S)
        maze_d = [[0]*(w+2) for _ in range(h+2)]
        queue = deque([(x, y, 0)])
        d = 0
        while queue:
            x, y, d = queue.popleft()
            d += 1
            maze[y][x] = 0
            if maze[y-1][x]:
                queue.append((x, y-1, d))
                maze[y-1][x] = 0
                maze_d[y-1][x] = d
            if maze[y][x-1]:
                queue.append((x-1, y, d))
                maze[y][x-1] = 0
                maze_d[y][x-1] = d
            if maze[y+1][x]:
                queue.append((x, y+1, d))
                maze[y+1][x] = 0
                maze_d[y+1][x] = d
            if maze[y][x+1]:
                queue.append((x+1, y, d))
                maze[y][x+1] = 0
                maze_d[y][x+1] = d
        max_dist = max(max_dist, max(chain_from_iterable(maze_d)))
print(max_dist)
X,Y,Z,K = list(map(int,input().split()))

A = sorted(list(map(int,input().split())))
A.reverse()
B = sorted(list(map(int,input().split())))
B.reverse()
C = sorted(list(map(int,input().split())))
C.reverse()

ia,ib,ic = 0,0,0
_min_ = 10000000000001
for ida,a in enumerate(A) :
    for idb,b in enumerate(B[:int(K/ida+1)]):
        idc = int(K/(ida+1)/(idb+1)) -1
        if  idc < len(C) and a+b+C[idc] < _min_:
            _min_ = a+b+C[idc]
            ia,ib,ic = ida,idb,idc

import itertools
#print(list(itertools.product(A[:s_a], B[:s_b],C[:s_c])))
for idx,value in enumerate(sorted([sum(i) for i in  list(itertools.product(A[:ia], B[:ib],C[:ic]))])[::-1]):
    if idx > K-1:
        break
    print(value)



### FIXED CODE ###

X,Y,Z,K = list(map(int,input().split()))
A = [(sorted(list(map(int,input().split())))[::-1]) for i in range(3)]
b = sorted([i+j for i in A[0] for j in A[1]])[-K:]
for i in sorted([i+j for i in b for j in A[2]])[-K:][::-1] :
  print(i)
n = input()

if n == "AAA" or n "BBB":
  print("NO")
else:
  print("YES")

### FIXED CODE ###

n = input()

if n == "AAA" or n == "BBB":
  print("No")
else:
  print("Yes")
"""

制約の小ささから見て全探索

"""

from itertools import product, accumulate
from bisect import *
import sys
input = sys.stdin.readline

H, W, K = map(int, input().split())
S = []
T = []
for i in range(H):
    S.append(list(map(int, input().strip())))
    T.append(list(accumulate([0] + S[-1])))

cnt_list = []
for a in product((0,1),repeat=H):
    past_a = a[0]
    T2 = [[0]*(W+1)]
    for i in range(H):
        if a[i] == past_a:
            for j, t in enumerate(T[i]):
                T2[-1][j] += t
        else:
            T2.append(T[i])
        past_a = a[i]
    cnt = len(T2) - 1
    l = 0
    flg = False
    while True:
        temp = []
        for s in T2:
            temp.append(bisect_right(s[l+1:], K + s[l]) + l)
        if min(temp) == 0:
            flg = True
            break
        else:
            l = min(temp)
        if l >= W:
            break
        else:
            cnt += 1
    if not flg:
        cnt_list.append(cnt)

print(min(cnt_list))



### FIXED CODE ###

"""

制約の小ささから見て全探索

"""

from itertools import product, accumulate
from bisect import *
import sys
input = sys.stdin.readline

H, W, K = map(int, input().split())
S = []
T = []
for i in range(H):
    S.append(list(map(int, input().strip())))
    T.append(list(accumulate([0] + S[-1])))

cnt_list = []
for a in product((0,1),repeat=H):
    past_a = a[0]
    T2 = [[0]*(W+1)]
    for i in range(H):
        if a[i] == past_a:
            for j, t in enumerate(T[i]):
                T2[-1][j] += t
        else:
            T2.append(T[i].copy())
        past_a = a[i]
    cnt = len(T2) - 1
    l = 0
    flg = False
    while True:
        temp = []
        for s in T2:
            temp.append(bisect_right(s[l+1:], K + s[l]) + l)
        if min(temp) == 0:
            flg = True
            break
        else:
            l = min(temp)
        if l >= W:
            break
        else:
            cnt += 1
    if not flg:
        cnt_list.append(cnt)

print(min(cnt_list))
N = int(input())
A = [int(s) for s in input().split()]
ans = sorted(range(len(A)), key=lambda k: A[k])
ans = [str(i+1) for i in ans]

print(' '.join(ans))

### FIXED CODE ###

N = int(input())
if (N==1):
  print(1.0)
elif(N%2==0):
  print((N//2)/N)
else:
  print(((N//2+1)/N))
m = input().split()
N = int(m[0])
Y = int(m[1])
if Y > 10000*N:
  print(-1,-1,-1)
else:
  frag = 1
  for i in range(N+1):
    for j in range(N-i+1):
      if frag == 1 and 10000*i + 5000*j + 1000*(N-i-j) == Y:
        frag == 0
        print(i,j,k)
        break
  if frag == 1:
    print(-1,-1,-1)

### FIXED CODE ###

m = input().split()
N = int(m[0])
Y = int(m[1])
if Y > 10000*N:
  print(-1,-1,-1)
else:
  frag = 0
  for i in range(N+1):
    for j in range(N-i+1):
      if frag == 0 and 10000*i + 5000*j + 1000*(N-i-j) == Y:
        frag = 1
        print(i,j,N-i-j)
        break
  if frag == 0:
    print(-1,-1,-1)
#B
N, K = [int(x) for x in input().split()]
#print(N, K)#
def count(n):
    if n<=0: return 1
    else:  return (K-1)*count(n-1)
print(K*count(N-1))

### FIXED CODE ###

#B 解2
N, K = [int(x) for x in input().split()]
#print(N, K)#
print(K*(K-1)**(N-1))
input_str = input().split("\n")
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [int(temp - (Hn * 0.006)) for Hn in Hn]

print(int((avg_temp.index(max(avg_temp)))+1))


### FIXED CODE ###

def main(n, t, a, h):
    def formula(t, x): return t - x * 0.006
    res = []

    for _h in h:
        res.append(abs(a - formula(t, _h)))

    print(res.index(min(res)) + 1)


if __name__ == "__main__":
    n = int(input())
    t, a = map(int, input().split(' '))
    h = list(map(int, input().split(' ')))

    main(n, t, a, h)
l



### FIXED CODE ###

i = 1
while True:
  n = int(input())
  if n == 0:
    break
  print("Case ", i, ": ", n, sep = "")
  i = i+1
import collections
H,W = list(map(int , input().split()))
D = []
for j in range(H):
    x=list(input())
    D.extend(x)
s = len((set(D)))
c = collections.Counter(D)
Q = []

for i in range(s):
    Q.append(c.most_common()[i][1])
if ((H*W)%2 == 1):
    seigen = (H//2+1)*(W//2 +1)
    q = 0
    for k in range(s):
        q += (Q[k] % 2)
    if (q == 1)and(s<=seigen):
        print("Yes")
    else:
        print("No")
elif ((H%2) == 0)and((W %2) ==0):
    q = 0
    for k in range(s):
        q += (Q[k] % 4)
    if ((s % 2) == 0)and(q == 0):
        print("Yes")
    else:
        print("No")

else:
    q = 0
        
    if ((H%2) == 1):
        seigen = (H//2+1)*W
    elif ((W%2) == 1):
        seigen = (W//2+1)*H
    for k in range(s):
        q += (Q[k] % 2)
    if (q == 0)and(s<=seigen):
        #print("Yes")
    else:
        #print("No")


### FIXED CODE ###

import collections
H,W = list(map(int , input().split()))
D = []
for j in range(H):
    x=list(input())
    D.extend(x)
s = len(list((set(D))))
c = collections.Counter(D)
Q = []

for i in range(s):
    Q.append(c.most_common()[i][1])
if s == 1:
    print("Yes")
else:
    if ((H*W)%2 == 1):
        seigen = (H//2+1)*(W//2 +1)
        q = 0
        m = 0
        mm = (H*W-(H//2)*(W//2)*4)//2+1
        for k in range(s):
            q += (Q[k] % 2)
            if (Q[k] % 4)!= 0:
                m += 1
        if (q == 1)and(s<=seigen)and (m <= mm):
            print("Yes")
        else:
            print("No")
    elif ((H%2) == 0)and((W %2) ==0):
        seigen = (H*W)//4
        q = 0
        for k in range(s):
            q += (Q[k] % 4)
        if ((s <= seigen)and(q == 0)):
            print("Yes")
        else:
            print("No")

    else:
        q = 0
        e = 0
        if ((H%2) == 1):
            seigen = (H//2+1)*W
            seigen2 = W//2
        elif ((W%2) == 1):
            seigen = (W//2+1)*H
            seigen2 = H//2
        for k in range(s):
            q += (Q[k] % 2)
            if (Q[k] % 4)!= 0:
                e += 1
        if (q == 0)and(s<=seigen)and(e<=seigen2):
            print("Yes")
        else:
            print("No")
#include<iostream>
#include<algorithm>
#include <vector>
#include <numeric>
using namespace std;

int main(){
    int n;
    int max_s=0;
    int sum_s=0;
    int L;

    cin>>n;
    for (int i=0;i<n;i++){
        cin>>L;
        sum_s+=L;
        max_s=max(max_s,L);
    }  	
	if (max_s<sum_s-max_s){
    cout<<"Yes"<<endl;
    }else{
    cout<<"No"<<endl;
    }
    return 0;
}


### FIXED CODE ###

n=int(input())
l=sorted(map(int,input().split()))
print(["No","Yes"][l[-1]<sum(l)-l[-1]])
import sys
a = []
for l in sys.stdin:
    a.append(l)

zahyou = [int(x) for x in a.split()]

if ((zahyou[0] >= zahyou[1]) and (zahyou[1] >= zahyou[2])) or ((zahyou[0] <= zahyou[1]) and (zahyou[1] <= zahyou[2])):
    print("No")
else:
    print("Yes")

### FIXED CODE ###

import sys
a = []
for l in sys.stdin:
    a.append(l)

zahyou = [int(x) for x in a[0].split()]
a, b, c = zahyou
if max(zahyou) == c or min(zahyou) == c:
    print("No")
else:
    print("Yes")
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, k = na()
# last sum
if k > (n-1)*(n-2)//2:
    print("-1")
else:
    cur = (n-1)*(n-2)//2-k
    ps = []
    for i in range(n-1, 1, -1):
        h = i*(i-1)//2
        if cur // h > 0:
            ps.append(*([i]*(cur//h)))
            cur %= h
    assert cur == 0
    es = []
    for i in range(1, n):
        es.append((1, i+1))
    c = 2
    for p in ps:
        for i in range(p):
            for j in range(p):
                if i < j:
                    es.append((c+i, c+j))
        c += p
    print(len(es))
    for e in es:
        print(e[0], e[1])


### FIXED CODE ###

import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, k = na()
# last sum
if k > (n-1)*(n-2)//2:
    print("-1")
else:
    es = []
    cur = (n-1)*(n-2)//2-k
    for c in range(2, n+1):
        for d in range(2, n+1):
            if c < d and cur > 0:
                es.append((c, d))
                cur -= 1
    for i in range(1, n):
        es.append((1, i+1))
    print(len(es))
    for e in es:
        print(e[0], e[1])
n = int(input())
l = [int(i) for i in input().split()]

l.sort(reverse=True)

max = l[0]
els = sum(l[1:])

if max > else:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())
l = [int(i) for i in input().split()]

l.sort(reverse=True)

max = l[0]
els = sum(l[1:])

if max < els:
  print("Yes")
else:
  print("No")