Harryxun/stf_run huggingface dataset:
N, A, B = map(int, input().split())
l = []

for i in range(N):
  value = 0
  for j in range(len(list(str(i+1)))):
    value += int(list(str(i+1)))[j]
  if A <= value and value <= B:
    l.append(value)
    
print(sum(l))

### FIXED CODE ###

N, A, B = map(int, input().split())
l = []
 
for i in range(N):
  value = 0
  for j in range(len(list(str(i+1)))):
    value += int(list(str(i+1))[j])
  if A <= value and value <= B:
    l.append(i+1)
    
print(sum(l))
a,b = map(lambda x: int(x),input().split())

if n == m :
    print('Yes')
else :
    print('No')


### FIXED CODE ###

n,m = map(lambda x: int(x),input().split())

if n == m :
    print('Yes')
else :
    print('No')
x,t=map(int.input().split())
print(x-t)

### FIXED CODE ###

x,t=map(int,input().split())
print(x-t if x >= t else 0)
import time
from memory_profiler import profile

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

suml = [1e5 for i in range(N)]
suml[0] = 0
suml[1] = abs(h[1] - h[0])
 
#@profile
def netMain():
    for e in range(2, N):
        suml[e] = min(
            abs(h[e]-h[e-1]) + suml[e-1],
            abs(h[e]-h[e-2]) + suml[e-2],
        )
 
netMain()
print(suml[N-1])


### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
 
suml = [1e5 for i in range(N)]
suml[0] = 0
suml[1] = abs(h[1] - h[0])
 
for e in range(2, N):
    suml[e] = min(
        abs(h[e]-h[e-1]) + suml[e-1],
        abs(h[e]-h[e-2]) + suml[e-2],
    )
 
# print(suml)
print(suml[N-1])
while True:
    H,W=map(int,input().split())
    for i in range(H):
        pirnt("W"*#)


### FIXED CODE ###

while True:
    H,W=map(int,input().split())
    if H==0 and W==0:
        break
    for i in range(H):
            print(W*"#")
    print("")
s = input()
c = 0
n = len(s)
print(n)
if n%2 == 0:  
	for i in range(n/2):
		if s[i]!=s[-(i+1)]:
			c = c + 1
else:
    for i in range(int((n+1)/2)):
        if s[i]!=s[-(i+1)]:
            c = c + 1
print(c)

### FIXED CODE ###

s = input()
c = 0
n = len(s)
if n%2 == 0:  
	for i in range(int(n/2)):
		if s[i]!=s[-(i+1)]:
			c = c + 1
else:
    for i in range(int((n+1)/2)):
        if s[i]!=s[-(i+1)]:
            c = c + 1
print(c)
import itertools
n = int(input())
dn = list(map(int, input().split())
print(sum(d*cumulate for d, cumulate in zip(dn[1:], itertools.accumulate(dn)))

### FIXED CODE ###

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

sum = 0
for i in range(n):
    for j in range(i+1,n):
        sum += d[i]*d[j]

print(sum)
k = [i for i in range(1, 10 ** 5 + 1)]
v = [0] * 10 * 5
dic = {key: val for key, val in zip(k, v)}
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  dic[a[i]] += 1
q = int(input())
ans = [sum(a)]
for i in range(q):
  b, c = map(int, input().split())
  ans.append(ans[-1] + (c - b) * dic[b])
  dic[c] += dic[b]
  dic[b] = 0
for i in range(1, q + 1):
  print(ans[i])

### FIXED CODE ###

k = [i for i in range(1, 10 ** 5 + 1)]
v = [0] * (10 ** 5)
dic = {key: val for key, val in zip(k, v)}
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  dic[a[i]] += 1
q = int(input())
ans = [sum(a)]
for i in range(q):
  b, c = map(int, input().split())
  ans.append(ans[-1] + (c - b) * dic[b])
  dic[c] += dic[b]
  dic[b] = 0
for i in range(1, q + 1):
  print(ans[i])
s = input().strip()

mod = 1
stable = 0
calc = {i: 0 for i in range(13)}
for c in reversed(s):
    if c == '?':
        calc[mod] += 1
    else:
        stable = (int(c) * mod + stable) % 13
    mod = (mod * 10) % 13

value = stable % 13

DIV = 10**9 + 7

# combis = {}
# def combi(n, r):
#     if r == 0:
#         return 1
#     elif (n, r) in combis:
#         return combis[n, r]
#     else:
#         res = combi(n, r - 1) * (n + 1 - r) // r
#         combis[n, r] = res
#         return res

patterns = {}
def get_pattern(d, n):
    if n == 0 or d * 9 == n:
        return 1
    elif d * 9 < n:
        return 0
    elif d == 1:
        return 1
    elif (d, n) in patterns:
        return patterns[d, n]
    else:
        res = 0
        for i in range(1, d):
            for j in range(9 * d + 1):
                res = get_pattern(i, j) * get_pattern(d-i, n-j)
        patterns[d, n] = res % DIV
        return res

def get_chance(point, value, chance):
    if point == 13:
        if value == 5:
            pat = 1
            for pt, val in enumerate(chance):
                pt += 1
                pat = (pat * get_pattern(calc[pt], val)) % DIV
            return pat
        else:
            return 0
    res = 0
    if calc[point] == 0:
        res = get_chance(point + 1, value, chance + [0])
    else:
        for i in range(calc[point] * 9 + 1):
            res += get_chance(point + 1, (value + i * point) % 13, chance + [i])
    return res

result = get_chance(1, value, [])

print(result)

### FIXED CODE ###

s = input().strip()

DIV = 10**9 + 7
new = list(range(13))
old = None

c = s[-1]
if c == '?':
    old = [int(t < 10) for t in range(13)]
else:
    c = int(c)
    old = [int(t == c) for t in range(13)]

digit = 10
for i, c in enumerate(reversed(s[:-1])):
    for j in range(13):
        new[j] = 0
    if c == '?':
        for m in range(10):
            for mod, cnt in enumerate(old):
                shifted = (mod + m * digit) % 13
                new[shifted] += cnt
    else:
        c = int(c)
        for mod, cnt in enumerate(old):
            shifted = (mod + c * digit) % 13
            new[shifted] += cnt
    for j in range(13):
        new[j] %= DIV
    new, old = old, new
    digit = (digit * 10) % 13

print(old[5])
def mi():
    return map(int, input().split())
'''
3 2
5 1 4
2 3
1 5
'''
n,m = mi()
a = list(mi())
a.sort()
q = [0]*m
for i in range(m):
    q[i] = list(mi())[::-1]
q.sort(reverse=True)
mi = 0
for i in range(m):
    for j in range(q[i][1]):
        if a[mi]<q[i][0]:
            a[mi] = q[i][0]
            mi+=1
            if mi==n:
                break
        else:
            break
print(sum(a))



### FIXED CODE ###

I=lambda:list(map(int,input().split()))
n,m=I()
a=I()
a.sort(reverse=True)
qq=[I() for i in range(m)]
qq.sort(key=lambda x:x[1],reverse=True)
ans=0
for x,y in qq:
    for j in range(x):
        if not a:
            break
        aa=a.pop()
        ans+=max(aa,y)
ans+=sum(a)
print(ans)
n, k, x, y = int(input().split()) for _ in range(4)
t = 0
if n - k > 0:
  t = (n  - k) * y
print(k * x + t)

### FIXED CODE ###

n,k,x,y=(int(input()) for i in range(4))
if n - k > 0:
  ans = k * x + (n - k) * y
else:
  ans = n * x
print(ans)
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
	
def main():
	S = input()
	S = list(S)
	K = int(input())
	
	if len(S) == 1:
		print(S[0])
	"""
	L = []
	for i in range(len(S)):
		if i == 0:
			tmp = int(S[i])
			if tmp == 1:
				L.append((i+1, tmp))
			else:
				tmp = (tmp ** ((5000 * 10000000000000)-1)) // 10
				L.append((i+1, tmp))
			continue
			
		_, base = L[i-1]
		tmp = int(S[i])
		if tmp == 1:
			tmp = 1
		else:
			tmp = (tmp ** ((5000 * 10000000000000)-1)) // 10
		L.append((i+1, tmp+base))
		
	for i in L:
		index, keta = i
		if i == 0:
			if K < keta:
				print(S[index])
				break
		if K < keta:
			print(S[index-1])
			break
			
	print(L)
	"""
	
	tmp = []
	for i in S:
		flg = False
		if int(i) == 1:
			tmp.append(1)
		else:	
			tmp.append(int(i))
			if flg = True:
				break
			flg = True
	
	a = np.random.randint(100)
	
	if len(tmp) < K:
		if a == 0
			print(tmp[-1])
		else:
			print(tmp[-2])
	else:
		tmp[K-1]
	
if __name__ == "__main__":
	main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
	
def main():
	S = input()
	S = list(S)
	K = int(input())
	
	if len(S) == 1:
		print(S[0])
		sys.exit()
		
	tmp = -1
	for i, val in enumerate(S):
		if int(val) != 1:
			tmp = int(i)+1
			break
	
	if K >= tmp:
		print(S[tmp-1])
	else:
		print(1)
	
if __name__ == "__main__":
	main()
S = input().rstrip()
s = list(S)
print(s)
N = len(S)
c = 0
if N == 1:
  print(0)
else:
  for i in range(1,N)
  	if S[i-1] == '0' and S[i] == '0':
      S[i] = 1
      c +=1
    elif S[i-1] == '1' and S[i] == '1':
      S[i] = 0
      c +=1
print(c)

### FIXED CODE ###

S = input().rstrip()
s = list(S)
N = len(S)
c = 0
v = [None] * N
v[0] = s[0]
if N == 1:
  print(c)
else:
  for i in range(1,N):
    
    if s[i]=='0' and v[i-1] =='0':
      v[i] = '1'
      c +=1
    elif s[i] =='1' and v[i-1] == '1':
      v[i] = '0'
      c +=1
    elif s[i] =='1' and v[i-1] == '0':
      v[i] = '1'
    elif s[i] =='0' and v[i-1] == '1':
      v[i] = '0'
    

  print(c)
import sys

def parse(inp):
    S=list(map(int,list(next(inp))))
    return S

def main(inp):
    S=inp
    i = 0
    count = 0
    while i < len(S)-1:
        if(S[i] != S[i+1]):
            del S[i:i+2]
            i=0
            count += 2
        else: i += 1
            
    return count
  
print(main(parse(sys.stdin)))

### FIXED CODE ###

import sys

def parse(inp):
    S=list(next(inp))
    return S
  
def main(inp):
    S = inp
    zeros=0
    ones=0
    for i in range(len(S)):
        if(S[i]=='0'): zeros+=1
        elif(S[i]=='1'): ones+=1
            
    return 2*min(ones,zeros)
  
print(main(parse(sys.stdin)))
while 1:
  h, w = map(int, input().split)
  if h == w == 0:
    break
  for i in  range(h):
    if i == 0 or i == h-1:
      print "#" * w
    else:
      print "#" + "." * (w - 2) + "#"
  print ""

### FIXED CODE ###

while 1:
  h, w = map(int, raw_input().split())
  if h == w == 0:
    break
  for i in  range(h):
    if i == 0 or i == h-1:
      print "#" * w
    else:
      print "#" + "." * (w - 2) + "#"
  print ""
n,a,b = map(int,input().split())
lim = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

print((pow(2,n,p)-combination(n,a)-combination(n,b)-1) % lim)

### FIXED CODE ###

n,a,b = map(int,input().split())
lim = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

print((pow(2,n,lim)-combination(n,a)-combination(n,b)-1) % lim)
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 0
min_diff = 10**5
for i in range(N):
  if abs((T - H[i]*0.006) - A) < min_diff:
    ans = i+1
    min_diff = abs((T - H[i]*0.006) - A)
print(ans)


### FIXED CODE ###

X, Y = map(int, input().split())
print(X+Y//2)
#coding: UTF-8
import math

p = list(map(float, input().split()))
dis = math.sqrt((abs(p[2]) - abs(p[0]))^2 + (abs(p[3]) - abs(p[1]))^2)

print(round(dis, 8))



### FIXED CODE ###

#coding: UTF-8
import math

p = list(map(float, input().split()))
# dis = math.sqrt(pow((abs(p[2]) - abs(p[0])), 2) + pow((abs(p[3]) - abs(p[1])), 2))
dis = math.sqrt(pow((p[2] - p[0]), 2) + pow((p[3]) - (p[1]), 2))

print(round(dis, 8))
N = int(input())
*a, = map(int, input().split())
ans = 0

for i in range(N):
	if i = a.index(a[i]):
		ans += 1
print(ans)


### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(N):
    j = a[i] - 1
    if i < j and a[j] - 1 == i:
        ans += 1
print(ans)
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

S = input()

tmp = []
tmp.append(-1)
for i, x in enumerate(S):
	if x != "A" and x != "T" and x != "G" and x != "C":
		tmp.append(i)
# print(tmp)
tmp2 = [tmp[i+1]-tmp[i] for i in range(len(tmp)-1)]
print(max(tmp2)-1)

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

S = input()

tmp = []
tmp.append(-1)
for i, x in enumerate(S):
	if x != "A" and x != "T" and x != "G" and x != "C":
		tmp.append(i)
tmp.append(len(S))
# print(tmp)
tmp2 = [tmp[i+1]-tmp[i] for i in range(len(tmp)-1)]
print(max(tmp2)-1)
N, *d = map(int, open(0))
print(sum(d)-max(s)/2)

### FIXED CODE ###

N, *d = map(int, open(0).read().split())
print(int(sum(d)-max(d)/2))
judge = True
if "##" in s[a - 1:c] or "##" in s[b - 1:d]:
    judge = False

if judge and c > d:
    if not "..." in s[b - 2:d + 1]:
        judge = False

print("Yes") if judge else print('No')    

### FIXED CODE ###

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

judge = True
if "##" in s[a - 1:c] or "##" in s[b - 1:d]:
    judge = False

if judge and c > d:
    if not "..." in s[b - 2:d + 1]:
        judge = False

print("Yes") if judge else print('No')
import numpy as np

def read_data():
    try:
        LOCAL_FLAG
        import codecs
        import os

        lines = []
        file_path = os.path.join(os.path.dirname(__file__), 'data.dat')
        with codecs.open(file_path, 'r', 'utf-8') as f:
            n_lines = int(f.readline())
            for i in range(n_lines):
                lines.append(f.readline().rstrip("\r\n"))

    except NameError:
        lines = []
        n_lines = int(input())
        for i in range(n_lines):
            lines.append(input())
    return lines



MAX = 10000000000

raw_data = read_data()
tarray = []
for each in raw_data:
    tarray.append(each.split())
A = np.array(tarray, dtype='int32')
B = np.zeros(A.shape, dtype='int32')

N = A.shape[0]

def distance2(i, j, done=[]):
    if(i == j):
        return 0

    min_dis = MAX
    min_index = -1
    for n in range(N):
        if((B[i][n] == 1)and(n not in done)and(n != j)):
            temp_dis = distance2(i, n, [i, j]) + distance2(n, j, [i, j])

            if(temp_dis < min_dis):
                min_index = n
                min_dis = temp_dis

    if(B[i][j] == 1)and(A[i][j] < min_dis):
        return A[i][j]
    else:
        return min_dis


def Restoring_Road_Network():

        # todo = list(range(N))
    min_dis_all = A[A.nonzero()].min()
    try:
        LOCAL_FLAG
        print("min value is", min_dis_all)
    except:
        pass

    for i in range(0, N):
        row = A[i]
        np.argmin(A[i])
        # print(row)
        min = MAX
        min_index = -1

        for j in range(0, N):
            if(row[j] == 0):
                continue
            elif(row[j] < min_dis_all*2):
                B[i][j] = 1
                B[j][i] = 1

            if(row[j] < min):
                min = row[j]
                min_index = j
        #
        # print(min)
        # print(min_index)
        B[i][min_index] = 1
        B[min_index][i] = 1


    distance_array = A*B
    not_available = False
    for i in range(N):
        for j in range(N):
            temp = distance2(i,j)
            # print(temp, " ", end='')
            if(temp != A[i][j]):
                not_available = True
        # print()

    try:
        LOCAL_FLAG
        print(B)
    except:
        pass

    if(not_available):
        print(-1)
    else:
        print(int(distance_array.sum(dtype=np.int64)/2))



# Sugar_water()
Restoring_Road_Network()

### FIXED CODE ###

import numpy as np
N = int(input())
A = [np.array(input().split(), dtype=np.int64) for _ in [0]*N]
inf = 10**10
for i in range(N):
    A[i][i] = inf
 
result = 0
for i in range(N-1):
    for j, d1 in enumerate(A[i][i+1:], start=i+1):
        d2 = np.min(A[i]+A[j])
        if d1 >= d2:
            if d1 > d2:
                print(-1)
                exit()
        else:
            result += d1
print(result)
n,k = map(int , input().split( ))
p = list(map(int , input().split( ))
 
p.sort()
 
temp = 0
for i in p[:k] :
  temp += i
print(temp)

### FIXED CODE ###

n,k = map(int , input().split( ))
p = list(map(int , input().split( )))
 
p.sort()
 
temp = 0
for i in p[:k] :
  temp += i
print(temp)
s, t = input(), input()

ls = len(s)
lt= len(t)
print(ls,lt)
is_double = False

for i in range(0,lt):
  size = lt-i
  for j in range(0,lt-size+1):
    jps = (j+size)
    # 0 j (j+size) lt
    _t = t[j:jps]
    print(i,j,size,_t, f'\t{s[j:ls-(lt-(j+size))]}')
    if _t in s[j:ls-(lt-(j+size))]:
      is_double = True
      break
  if is_double:
    print(i)
    break

if not is_double:
  print(lt)



### FIXED CODE ###

s, t = input(), input()

ls = len(s)
lt= len(t)
is_double = False
c = len(s)
for i in range(ls-lt+1):
  _c = 0 
  for j in range(lt):
    if not s[i+j] == t[j]:
      _c +=1
  if c > _c:
    c = _c
    
print(c)
1001 2000 520
1002 1800 450
1003 1600 625
1001 200 1220

### FIXED CODE ###

while True:
	n = int(raw_input())
	if n == 0:
		break
	data = {}
	order = []
	for i in range(n):
		id,price,quant = map(int, raw_input().split())
		if id in data:
			data[id] += price*quant
		else:
			data[id] = price*quant 
			order.append(id)
	if max(data.values()) <  1000000:
		print "NA"
	else:
		for k in order:
			if data[k] >=  1000000:
				print k
a = input()
b = input()
print a*b +' ' + 2*(a+b)

### FIXED CODE ###

m = map(int,raw_input().split())
print m[0]*m[1],2*(m[0]+m[1])
a = int(input())
result = 0
if a mod 2 == 0:
  print(a * a / 2)
else:
  print(a * (a - 1) / 2)


print(result)

### FIXED CODE ###

a = int(input())
print(int(a * (a - 1) // 2))
I,*U=N,*D=9**9,
P,*L='x+y,',
M,*R='x-y,',
for t in[*open(n:=0)][1:]:*z,u=t.split();exec(u+'+=[*map(int,z)],')
for*A,S in(D,U,'x,y,'),(L,R,'y,x,'),(U,R,P+M),(L,D,P+M),(L,U,M+P),(D,R,M+P):
 for x,y,r in eval('sorted((%sQ)for Q,P in enumerate(A)for x,y in P)'%S):
  if r:n,p=x,y
  elif x==n:N=min(N,y-p)
print(N%I*5or'SAFE')

### FIXED CODE ###

d=[[],[],[],[]]
for t in[*open(0)][1:]:*z,u=t.split();d[ord(u)%5]+=[*map(int,z)],
I=N=9**9
P,M='x+y,','x-y,'
for*A,S in(3,0,'x,y,'),(1,2,'y,x,'),(0,2,P+M),(1,3,P+M),(1,0,M+P),(3,2,M+P):
 n=p=-I
 for x,y,r in eval('sorted((%sQ)for Q,P in enumerate(A)for x,y in d[P])'%S):
  if r:n,p=x,y
  elif x==n:N=min(N,y-p)
print(N%I*5or'SAFE')
from collections import Counter
H, W = map(int, input().split())
D = []
for _ in range(H):
    D.extend(list([v for v in input()]))
C = Counter(D)
L = list([v for i, v in C.most_common()])

if H == 1 and W == 1:
    ans = "Yes"
elif H == 1 or W == 1:
    if sum([1 if v % 2 == 1 else 0 for v in L]) == 1:
        ans = "Yes"
    else:
        ans = "No"
elif H % 2 == 1 and W % 2 == 1:
    if sum(v % 2 for v in L) == 1 and (sum(1 if v % 4 == 0 else 0 for v in L) == len(L)-1 or (sum(1 if v % 4 == 0 else 0 for v in L)) == len(L)-2):
        ans = "Yes"
    else:
        ans = "No"
elif H % 2 == 0 and W % 2 == 0:
    if all(v % 4 == 0 for v in L):
        ans = "Yes"
    else:
        ans = "No"
else:
    assert 1 == 2
    if sum(v % 2 for v in L) == 0 and (sum(1 if v % 4 == 0 else 0 for v in L) == len(L)-1 or (sum(1 if v % 4 == 0 else 0 for v in L)) == len(L)-2):
        ans = "Yes"
    else:
        ans = "No"
print(ans)

# 1.2.4.


### FIXED CODE ###

from collections import Counter
H, W = map(int, input().split())
D = []
for _ in range(H):
    D.extend(list([v for v in input()]))
C = Counter(D)
L = list([v for i, v in C.most_common()])

g1 = sum(v % 2 for v in L)
g4 = sum(v//4 for v in L)

if g4 >= (W-(W % 2))*(H-(H % 2))//4 and g1 == H & 1 & W:
    print("Yes")
else:
    print("No")
import numpy as np
W,H,x,y = map(int, input().split())

d_center_W = abs(W/2 - x)
d_center_H = abs(H/2 - y)
d_45_plus =  abs((H/W)*x-1*y)/np.sqrt((H/W)**2+(-1)**2)
d_45_minus = abs((H/W)*x+y-H)/np.sqrt((H/W)**2+1**2)

min_d = min(d_center_W,d_center_H,d_45_plus,d_45_minus)
smflg = False

if [d_center_W,d_center_H,d_45_plus,d_45_minus].count(min_d) > 1:
        smflg = True

ans = 0

if min_d == d_center_W:
        if x <= W/2:
                ans = x*H/1
        else:
                ans = (W-x)*H/1
elif min_d == d_center_H:
        if y <= H/2:
                ans = y*W/1
        else:
                ans = (H-y)*W/1
elif min_d == d_45_plus:
        if y/x >= H/W:
                ans = H-(y-(H/W)*x)*(W-(W/H)*y+x)/2
        else:
                ans = (H-(x-(W/H)*y))*(H+y-(W/H)*x)/2
elif min_d == d_45_plus:
        if x <= W/2:
                x += (W/2-x)*2
        else:
                x -= (x-W/2)*2
        if y/x >= H/W:
                ans = H-(y-(H/W)*x)*(W-(W/H)*y+x)/2
        else:
                ans = (H-(x-(W/H)*y))*(H+y-(W/H)*x)/2
if smflg:
        smstr = '1'
else:
        smstr = '0'
print(str(ans) + ' ' + smstr)


### FIXED CODE ###

W,H,x,y = map(int, input().split())
print(W*H/2)
if x == W/2 and y == H/2:
    print(1)
else:
    print(0)
from bisect import bisect_left
N = int(input())
a=list(map(int, input().split()))
Q = int(input())
b=[]
c=[]
for i in range(Q):
  b1,c1=map(int, input().split())
  b.append(b1)
  c.append(c1)
def index(lst, e):
    i = bisect_left(lst, e)
    if i == len(lst):
        raise ValueError
    if lst[i] != e:
        raise ValueError
    return i
for i in range(Q):
  first=0
  last = 0
  a.sort()
  if b[i] not in a:
    print(sum(a))
  else:
    last = a.count(b[i])
    first = index(a,b[i])
    del a[first:first+last]
    list_c = [c[i]]*last
    a = a+list_c
    print(sum(a))
  
  
  



### FIXED CODE ###

N = int(input())
a = list('abcdefghijklmnopqrstuvwxyz')
name = 0
while N!=0:
  N-=1
  M = N%26
  N = N//26
  if name ==0:
    name = a[M]
  else:
    name = a[M]+name

print(name)
N = int(input())
D = sorted(list(map(int,input().split())))
ans = 1
D.append(-1)
if D[0]>0:
    ans = 0
elif D[1]==0:
    ans = 0
else:
    cur = 0
    n1 = 1
    n2 = 1
    for i,d in enumerate(D[1::],1):
        if d == cur:
            n2 += 1
        else:
            ans *= n1**n2
            ans %= 998244353                
            n1 = n2
            n2 = 1
            cur = d
print(ans)


### FIXED CODE ###

N = int(input())

if N%2 == 0:
    print(int(N//2-1))
else:
    print(int((N+1)//2-1))
n = int(input())
A = input()
A = A.split()
A = [int(i) for i in A]
A = sorted(A, reverse = True)
ans = 0

for x in A:
	ans += x

ans -= A[n-1]

print(ans)

### FIXED CODE ###

taka = int(input())
remainder = taka % 1000
ans = 1000 - remainder
print(ans % 1000)
A = int(input())
B = int(input())

pirnt(6-A-B)


### FIXED CODE ###

A = int(input())
B = int(input())

print(6-A-B)