peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

def check(l):
    t = 0
    for i in a:
        t += -(-i // l) - 1
    return t <= k

l, r = 0, 10 ** 9 + 1
while r - l > 1:
    mid = (l + r) // 2 + (l + r) % 2
    if check(mid):
        r = mid
    else:
        l = mid

print(r)
# Judge status: Wrong Answer
n = int(input())

for i in range(1, 26):
    for j in range(1, 16):
        if(4*i+7*j==n):
            print("Yes")
            break
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())

h=list(map(int,input().split()))
if h[-1]!=1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
total = sum(A)
mid = total // 2
sum_left, sum_left2 = 0, 0
sep_idx = 0
for i, l in enumerate(A):
  sum_left += l
  if sum_left >= mid:
    sep_i = i
    sum_left2 = sum_left - l
    break
sum_right, sum_right2 = sum(A[sep_i + 1:]), sum(A[sep_i:])
print(min(abs(sum_right - sum_left), abs(sum_right2 - sum_left2)))
# Judge status: Accepted
N, p = map(int,input().split())
if N < 10:
    K = 100 * (10 - N)
    print(p + K)
else:
    print(p)
# Judge status: Wrong Answer
a,b=map(int,input().split())
ans=0
for i in range(b):
    ans+=i
    if a<ans and ans<b :
        print(ans-a)
        break
    else :
        continue
# Judge status: Accepted
n = int(input())
A = sorted(list(map(int, input().split())))
print(sum(A[-2:-2 * n - 1:-2]))
# Judge status: Wrong Answer
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


s = S()
t = S()
ans = INF
for i in range(len(s)-len(t)):
    now = 0
    for j in range(i, i+len(t)):
        if s[j] != t[j-i]:
            now += 1
    ans = min(ans, now)

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

ans = 0
for i in a:
    ans ^= i

for i in a:
    print(ans ^ i, end = ' ')
# Judge status: Accepted
n, w = map(int, input().split())

if n*w==1:
    print(1)
elif n==1:
    print(w-2)
elif w==1:
    print(n-2)
elif n==2 or w==2:
    print(0)
else:
    print((n-2)*(w-2))
# Judge status: Accepted
from collections import deque

n, m = map(int,input().split())
graph =[[] for _ in range(n+1)]
for _ in range(m):
    a,b =map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)
queue = deque([1])
visited = [False] * (n+1)
visited[0] = True
ans = [0] * (n+1)
while queue:
    node = queue.popleft()
    for xnode in graph[node]:
        if visited[xnode]:
            continue
        ans[xnode]=node
        visited[xnode]=True
        queue.append(xnode)
print("Yes")
for a in ans[2:]:
    print(a)
# Judge status: Accepted
h = int(input())
w = int(input())
n = int(input())

x = max(h, w)
ans = (n + x - 1) // x
print(ans)
# Judge status: Wrong Answer
import sys
from itertools import accumulate, repeat, takewhile
from operator import mul


def main():
    N = int(next(sys.stdin.buffer))
    print(sum(N // x for x in takewhile(lambda x: x <= N, accumulate(repeat(5), mul, initial=10))))


if __name__ == '__main__':
    main()
# Judge status: Accepted
k = int(input())
a = 0

for i in range(k + 10):
    a = (a*10 + 7)%k
    if a == 0:
        print(i + 1)
        exit()
print(-1)
# Judge status: Accepted
N, K = map(int, input().split())
L = list(map(int, input().split()))
L.sort()
s = len(L)
L_dif = [[i,L[i+1]-L[i]] for i in range(s-1)]
L_dmax = L_dif.copy()
L_dmax.sort(key=lambda tup: tup[1:], reverse=True)
size = L[K-1]-L[0]
piv = min(K,N)
rem_dif = [L_dmax[i][1] for i in range(piv-1)]
ans = size - sum(rem_dif)
print(ans)
# Judge status: Accepted
#解説見ながら

n = int(input())

ans = n

for i in range(n+1) :
    c = 0
    a = n-i
    while a>0 :
        c += a%6
        a = a//6
    a = i
    while a>0 :
        c += a%9
        a = a//9
    if c<ans :
        ans = c

print(ans)
# Judge status: Wrong Answer
N=int(input())
A=int(input())

if N%500<=A:
	print('YES')
else:
	print('NO')
# Judge status: Accepted
s = input()
length = len(s)

maxlen = 0
for i in range(length//2-1):
  if s[0:(i+1)] == s[(i+1):2*(i+1)]:
    maxlen = 2*(i+1)
    
print(maxlen)
# Judge status: Accepted
a,b,c=map(int,input().split())
if a==b and a!=c:
    print("Yes")
elif a==c and a!=b:
    print("Yes")
elif b==c and b!=a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b = map(int,input().split())
if a>9:
  print(-1)
elif b>9:
  print(-1)
else:
  print(a*b)
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())
    s = input()
    ans = s.count(".")
    cur = ans

    for i, char in enumerate(s):
        if char == ".":
            cur -= 1
        else:
            cur += 1
        ans = min(ans, cur)

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
a=0
for i in range(n+1):
    if i%3!=0 and i%5!=0:  
        a+=i
print(a)
# Judge status: Accepted
N=int(input())
S=list(input())

max=0

for i in range(1,(N)):
  a=S[:i]
  b=S[i:]
  L= len(set(a)&set(b))
  if L>max:
    max=L
print(max)
# Judge status: Wrong Answer
k=list(map(int,input().split()))
k.sort
print(int(k[0])+int(k[1]))
# Judge status: Accepted
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

a,b,c = readInts()

i = a
his = []
while 1:
  if i%b==c:
    print("YES")
    exit()
  else:
    if i%b in his:
      print("NO")
      exit()
    else:
      his.append(i%b)
      i+=a
# Judge status: Wrong Answer
n = int(input())
l = list(map(int,input().split()))
a = l[n-1::-2]
if n % 2 == 0:
  a.append(l[0::2])
else:
  a.append(l[1::2])
print(a)
# Judge status: Accepted
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    need = 0
    stock = 0
    for a, b in zip(A, B):
        if a > b: need += (a-b)
        if b > a: stock += (b-a)//2

    if stock >= need:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()
# Judge status: Accepted
A,B,K = map(int,input().split())

if A >= K:
    A = A - K
    print(str(A)+ ' '+str(B))
else:
    B = B - (K - A)
    A = 0
    if B < 0:
        print('0 0')
    else:
        print(str(A)+ ' '+str(B))
# Judge status: Wrong Answer
n = int(input())
s = [input() for i in range(n)]
def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

# [[1, 1], [0, 1], [0, 0], [1, 0]]
for i in range(n):
    s[i] = sorted(s[i])
print(len(get_unique_list(s)))
# Judge status: Accepted
s = input()
if s[-1] == "s":
  print(s + "es")
else:
  print(s + "s")
# Judge status: Accepted
N = int(input())
c = input()

r = c.count("R")
w = c.count("W")
a = "R"*r+"W"*w

ans = 0
for i in range(N):
    if(c[i] != a[i]):
        if(c[i] == "W" and a[i] == "R"):
            ans += 1
print(ans)
# Judge status: Accepted
K,X = map(int, input().split())
if K*500 >= X:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
S = input()
T = input()

cnt = 0
for i in range(len(S)):
	if S[i] != T[i]:
		cnt += 1

print(cnt)
# Judge status: Accepted
n, x, t = input().split()
z = ((int(n)+int(x))-1)//int(x)
ans = z * int(t) 
print(ans)
# Judge status: Wrong Answer
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

def main():
    s = input().rstrip()
    ans = 0
    b = s[0]
    for i in s[1:]:
        i = int(i)
        if b == i:
            ans += 1
            b = 1-i
        else:
            b = i
    print(ans)



if __name__=="__main__":
    main()
# Judge status: Accepted
n = int(input())
x = 0
for i in range(1,n+1):
    if(i%2 == 1):
        x += 1

print(x/n)
# Judge status: Accepted
a=int(input())
for i in range(3):
    bcd=int(input())
e = int(input())
k=int(input())
if (e-a)>k:
    print(':(')
else:
    print('Yay!')
# Judge status: Accepted
from decimal import *
a, b, x = map(Decimal, input().split())
if a == 0:
    a_div = 0
else:
    a_div = (a-1) // x + 1
b_div = b // x + 1

ans = b_div - a_div
print(ans)
# Judge status: Wrong Answer
H = int(input())
W = int(input())
N = int(input())


if N % max(H, W) == 0:
    print(N / max(H, W))
else:
    print(round(N / max(H, W) + 1))
# Judge status: Accepted
S = input()
T = input()

for n in range(len(S)):
  S = S[-1]+S[:-1]
  if S==T:
    print("Yes")
    exit()
    
print("No")
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
cnt = 0

for i in range(1, n-1):
    if p[i-1]<p[i]<p[i+1] or p[i+1]<p[i]<p[i-1]:
        cnt += 1

print(cnt)
# Judge status: Accepted


def main():
    N, M, Q = [int(x) for x in input().split()]
    queries = [[int(x) for x in input().split()] for _ in range(Q)]

    ans = float("-inf")
    import itertools
    for A in itertools.combinations_with_replacement(range(1, M+1), N):
        # print(A)
        s = 0
        for a, b, c, d in queries:
            if A[b-1] - A[a-1] == c:
                s += d
        ans = max(ans, s)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s,i=0,0
for i in range(5):
  s=s+int(input())
  if i==4:
    print(s)
    exit()
  while(s>10*i):
    i+=1
  s=10*(i)
print(s)
# Judge status: Wrong Answer
a = input()
if a[0] == 9 or a[1] == 9:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s=list(input())
k=int(input())
for i in range(len(s)):
    if i==len(s)-1:
        s[-1]=chr((ord(s[i])-97+k)%26+97)
        break
    if s[i]=='a':
        continue
    if 123-ord(s[i])<=k:
        k-=123-ord(s[i])
        s[i]='a'
print(*s,sep='')
# Judge status: Accepted
#!/usr/bin/env python3
from collections import*
n, *d= map(int, open(0).read().split())
c = Counter(d)
if d[0] or c[0] > 1:
    exit(print(0))
MOD = 998244353
m = 1
for i in range(1, max(d)):
    m *= pow(c[i], c[i + 1], MOD)
    m %= MOD
print(m)
# Judge status: Wrong Answer
N=int(input())
ct=0
while N>1:
  N=N//2
  ct+=1
print(ct)
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))

xs = sorted(X)
median1 = xs[N//2-1]
median2 = xs[N//2]

for i in range(N):
    if X[i] == median1:
        print(median2)
    elif X[i] == median2:
        print(median1)
    elif X[i] < median1:
        print(median2)
    elif X[i] > median2:
        print(median1)
# Judge status: Accepted
K,X=list(map(int,input().split()))
if 500*K>=X:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())

if n >= 1000:
    print("ABD" + str(n - 999).zfill(3))
else:
    print("ABC" + str(n))
# Judge status: Wrong Answer
x,y=map(int,input().split())

if x<=y:
    if x<0 and -x<y:
        print(1+y+x)
    else:
        print(y-x)
elif y<x and 0<=x and 0<=y:
    print(y-(-x)+1)
elif y<x and 0<=x and y<0:
    print(-y-x+1)
elif y<x and x<0 and y<0:
    print(-y--x+2)
else:
    print(y-x)
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import defaultdict, deque
    n, m = map(int, readline().split())
    edge = defaultdict(set)

    for _ in range(m):
        a, b = map(int, readline().split())
        edge[a].add(b)
        edge[b].add(a)

    for u in edge[1]:
        if n in edge[u]:
            print("POSSIBLE")
            sys.exit()

    print("IMPOSSIBLE")

if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b = map(int,input().split())
print(a * b)
# Judge status: Wrong Answer
# 文字列を取得
C1 = str(input())
C2 = str(input())

# 文字列の結合
ori_str = C1 + C2

# 末尾から１文字ずつ取得して逆さま文字を生成
rev_str = ori_str[-1::-1]

# 比較結果を出力
if ori_str == rev_str:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]

print(c_min, c_max)
# Judge status: Wrong Answer

n, k = map(int, input().split())
S = input()

char_k = S[k-1]

S_ch = S.replace(S[k-1], str.lower(char_k))
print(S_ch)
# Judge status: Wrong Answer
a,b=map(int,input().split())
print("Yay" if abs(a-b)<=2 else ":(")
# Judge status: Wrong Answer
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
x=int(input())
ls=[a,b,c,d,e]
if (ls[1]-ls[0])<=x and (ls[2]-ls[1])<=x and (ls[3]-ls[2])<=x and (ls[4]-ls[3])<=x:
  print("Yay!")
else:
  print(":(")
# Judge status: Accepted
n=int(input())
s=list(input())

max=0
count=0

for i in range(1,len(s)):
    str1=set(list(s[0:i]))
    str2=set(list(s[i:n]))
    for c in str1:
        if c in str2:
            count+=1
            if max<=count:
                max=count
    count=0

print(max)
# Judge status: Wrong Answer
import sys

sum = 0
for x in sys.argv[1:]:
    sum += int(x)

if sum > 21:
    print('bust')
else:
    print('win')
# Judge status: Wrong Answer
W, H, N = map(int, input().split())
X_Y_A = [map(int, input().split()) for _ in range(N)]
oX = 0
oY = 0
for x, y, a in X_Y_A:
    if a == 1:
        oX = x
    elif a == 2:
        W = x
    elif a == 3:
        oY = y
    else:
        H = y
A = (W-oX)*(H-oY)
print(A) if A > 0 else print(0)
# Judge status: Accepted
N = int(input())

print(1000 - N % 1000 if N % 1000 != 0 else 0)
# Judge status: Wrong Answer
a, b, k = map(int, input().split())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

a_y = set(make_divisors(a))
b_y = set(make_divisors(b))
#print(a_y & b_y)
y = list(a_y & b_y)

print(y[k-1])
# Judge status: Accepted
h,a = map(int,input().split())

print(h//a if h%a == 0 else h//a +1)
# Judge status: Accepted
A, B, C, D = map(int, input().split())
while True:
    if C <= B:
        print("Yes")
        break
    if A <= D:
        print("No")
        break
    A -= D
    C -= B
# Judge status: Wrong Answer
N,K=map(int,input().split())
List=list(map(int,input().split()))
S=sorted(List)
if K==0:
    i=1
else:
    i=0
del S[i:K+1]
print(sum(S))
# Judge status: Wrong Answer
n, y = map(int, input().split())
for i in range(n+1):
  for g in range(n-i):
    s = n-i-g
    if 10000*i + 5000*g + 1000*s == y:
      print(i, g, s)
      exit()
print('-1 -1 -1')
# Judge status: Wrong Answer
from collections import Counter
S = str(input())
CS = Counter(S)
V = list(CS.values())
ans = 'YES'
if len(V) == 1:
  ans = 'NO'
elif len(V) == 2:
  if V[0] >= V[1]+1:
    ans = 'NO'
else:
  if V[0]-V[2] > 1 or V[1]-V[2] > 1 or V[0]-V[1] > 1:
    ans = 'NO'

print(ans)
# Judge status: Accepted
K, S = list(map(int, input().split()))

answer = 0
for i in range(K+1):
  for j in range(K+1):
    if S - (i + j) >= 0 and S - (i + j) <= K:
      answer += 1

print(str(answer))
# Judge status: Accepted
n,a,b=map(int,input().split())
s=input().strip()
njp=0
nop=0
for i in range(len(s)):
  if s[i]=='a':
    if njp<(a+b):
      njp+=1
      print('Yes')
    else:
      print('No')
  elif s[i]=='b':
    if njp<(a+b):
      if nop<b:
        nop+=1
        njp+=1
        print('Yes')
      else:
        print('No')
    else:
      print('No')
  else:
    print('No')
# Judge status: Wrong Answer
n,k,q =map(int,input().split())
a = [int(input()) for _ in range(q)]

point = [0]*n

for i in range(q):
    point[a[i]-1] += 1
print(point)

for i in range(n):
    if point[i]>= q-k+1:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
N = int(input())
n = input()    
m = n.split()
p = [int(i) for i in m]
a = 0
b = 1
import fractions
for i in p:
    c = fractions.gcd(i, b)
    a = (a * i // c + b // c) % 1000000007
    b = b * i // c
 

print(a)
# Judge status: Wrong Answer
n = input()
print("Yes" if (n[1] == n[2]) and len(set(n)) <= 2 else "No")
# Judge status: Accepted
C1=list(map(str,input()))
C2=list(map(str,input()))
if C1[0]==C2[2] and C1[1]==C2[1] and C1[2]==C2[0]:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n = int(input())
x = ""
while n != 0:
    x = str(n % 2)+x
    n = -(n//2)

print(0 if x == "" else x)
# Judge status: Accepted
S = input()

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
elif S == 'SAT':
    print('1')
else:
    print('Error')
# Judge status: Accepted
x=int(input())
if x==3 or x==5 or x==7:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n,a,b = map(int, input().split())
s = input()
students_passed = 0
rank = 0
for i, j in enumerate(s):
    if students_passed < a+b and j == 'a':
        students_passed += 1
        print('Yes')
    elif students_passed < a+b and j == 'b' and rank <= b-1:
        rank += 1
        students_passed += 1
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
A,B=map(int,input().split())
C=max(A,B)+min(A,B)
if C % 2 !=0:
    print("IMPOSSIBLE")
else:print(C//2)
# Judge status: Accepted
n = int(input())
nums = sorted(list(map(int, input().split(' '))), reverse=True)
bob = 0
alice = 0

for id, num in enumerate(nums):
    if id % 2 == 0:
        bob += num
    else:
        alice += num

print(bob - alice)
# Judge status: Wrong Answer
N = int(input())
s = input().split(" ")
A = []
d = {}
for w in s:
    A.append(int(w))
    if w in d.keys():
        d[w] += 1
    else:
        d[w] = 1

for n in range(N):
    if str(n + 1) in d.keys():
        print(d[w])
    else:
        print(0)
# Judge status: Wrong Answer
s = input()

if s[0] != 'A' or s[2] != 'C':
  print('WA')
else:
  for i,c in enumerate(s):
    if i in (0,2):
      continue
    else:
      if not 'a'<=c<='z':
        print('WA')
        break
  else:
    print('AC')
# Judge status: Accepted
x, y = map(int, input().split())

if (x+y)%3 != 0:
    print(0)
    exit(0)

n = (2*y-x)//3
m = (2*x-y)//3

if n<0 or m<0:
    print(0)
    exit(0)

mi = min(n,m)
num = n+m
mod = 10**9+7
a = 1
b = 1

for i in range(mi):
    a = a*(num-i)%mod
    b = b*(mi-i)%mod

print((a*pow(b,mod-2,mod))%mod)
# Judge status: Wrong Answer
cards = [list(input().replace("a", "0").replace("b","1").replace("c","2")) for _ in range(3)]
next = 0
while len(cards[0]) * len(cards[1]) * len(cards[2]) != 0:
  next = int(cards[next].pop(0))
print("A" if len(cards[0]) == 0 else ("B" if len(cards[1]) == 0 else "C"))
# Judge status: Accepted
N = int(input())

lucas = (N+2)*[0]
lucas[0] = 2
lucas[1] = 1
for i in range(2,N+2):
    lucas[i] = lucas[i-1]+lucas[i-2]

print(lucas[N])
# Judge status: Accepted
N, K = map(int, input().split())
R, S, P = map(int, input().split())
score = {"r": P, "s": R, "p": S, "x": 0}
T = input()

ans = 0

for i in range(K):
    temp = []
    for j in range(i, N, K):
        if not temp:
            temp.append(T[j])
        else:
            if temp[-1] == T[j]:
                temp.append("x")
            else:
                temp.append(T[j])
        ans += score[temp[-1]]
print(ans)
# Judge status: Accepted
def main():
    
    end, start, divisor = [int(i) for i in input().split()]
    a = start//divisor - (end-1)//divisor

    print(a)

main()
# Judge status: Accepted
A, B, C = map(int, input().split())
cnt = 0
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    A,B,C = B//2+C//2, A//2+C//2, A//2+B//2
    cnt += 1
    if cnt >= 10 * 7:
        print(-1)
        break
else:
    print(cnt)
# Judge status: Wrong Answer
N = int(input())
left = 0
right = 3162
while right - left > 1:
    mid = (left + right) // 2
    if mid * (mid + 1) // 2 < N:
        left = mid
    else:
        right = mid
ans = {i for i in range(1, right + 1)}
ans -= {right * (right - 1) // 2 - N + right}
print('\n'.join(map(str, ans)))
# Judge status: Accepted
r,g,b = map(int,input().split())
if (g*10+b)%4 == 0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
s=0
t=0
n=int(input())
for x in range(1,n+1):
    if x%2==1:
        s+=1
print(s/n)
# Judge status: Accepted
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit()
p = set(map(int, input().split()))

i = 0
while True:
  if x - i not in p:
    print(x-i)
    break
  elif x + i not in p:
    print(x+i)
    break
  
  i += 1
# Judge status: Accepted
#!/usr/bin/env python3
a,b,c = map(int,input().split())

if a > b: a,b = b,a
if a < c and c < b: print("Yes")
else: print("No")
# Judge status: Accepted
a, b = [int(x) for x in input().split()]
temp = b - a
print(temp * (temp + 1) // 2 - b)
# Judge status: Wrong Answer
a=input().split(' ')
b=a[1]
c=list(str(b))
print(c)
d=c[0]
print('A',d,'C',sep='')
# Judge status: Accepted
def main():
    n, a, b = list(map(int, input().split()))
    if (n == 1 and a != b) or (b < a):
        print(0)
        exit()
    mini = a * (n - 1) + b
    maxi = a + b * (n - 1)
    print(maxi - mini + 1)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
Asum = [0]
Bsum = [0]
a = 0
b = 0
for i in range(N):
    a += A[i]
    Asum.append(a)
for i in range(M):
    b += B[i]
    Bsum.append(b)
Asum.append(0)
Bsum.append(0)
res, j = 0, M
for i in range(N+1):
    if Asum[i] > K:
        break
    while Asum[i] + Bsum[j] > K:
            j -= 1
    res = max(res,i+j)
print(res)
# Judge status: Accepted
a=list(map(int,input().split()))
l=sorted(a,reverse=True)
max=str(l[0])+str(l[1])
print(int(max)+l[2])
# Judge status: Wrong Answer
import numpy as np
from bisect import bisect_left

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

cum_A = np.cumsum(A)
median = sum(A) / 2
idx = bisect_left(cum_A, median)

# print(idx)
if idx == N - 1:
    right = A[-1]
else:
    right = cum_A[-1] - cum_A[idx]
ans = abs(cum_A[idx] - right)
# print(cum_A, idx, right)
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

sum=0
for i in range(n):
    sum+=b[i]
#print(sum)
for j in range(n-1):
        if a[j+1]==a[j]+1:
            #print(a[j])
            #print(c[a[j]-1])
            sum+=c[a[j]-1]
print(sum)
# Judge status: Accepted
s = input()
n = len(s)
for i in range(1, n):
    if ord(s[i]) < 97 and s[i] != "C":
        print("WA")
        exit()
cnt_c = 0
for i in range(2, n - 1):
    if s[i] == "C":
        cnt_c += 1
if cnt_c != 1:
    print("WA")
    exit()
print("AC" if s[0] == "A" else "WA")
# Judge status: Accepted
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ab = ab[::-1]

z = 0
cnt = 0
for a, b in ab:
  a += z
  if a % b != 0:
    z += b - (a % b)
print(z)
# Judge status: Wrong Answer
N,M,X,Y = map(int,input().split())
x=max(list(map(int,input().split())))
y=min(list(map(int,input().split())))

for z in range(X+1,Y+1):
    if x<=z<=y:
        print("No War")
        exit()
print("War")
# Judge status: Wrong Answer
n, m = map(int, input().split())
mini, maxi = 0, 10**5+1

for _ in range(m):
    l, r = map(int, input().split())
    if l>mini:
        mini = l
    if r<maxi:
        maxi = r

print(maxi - mini + 1)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
if L[0] > sum(L[1:]):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
n=int(input())
h=[int(x) for x in input().split()][::-1]

for i in range(n-1):
    if h[i]>=h[i+1]:
        continue
    elif h[i]==h[i+1]-1:
        h[i+1]-=1
    else:
        print("No")
        sys.exit()
print("Yes")
# Judge status: Accepted
N=int(input())
H=list(map(int,input().split()))
if len(H)==1:
  print("Yes")
  exit()
for i in range(1,N):
  if H[i-1]<=H[i]-1:
    H[i]-=1
  elif H[i-1]>H[i]:
    print("No")
    exit()
else:
  print("Yes")