peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
x,a,b=map(int,input().split())
ans=b-a
if ans>=x+1:
    print('dangerous')
elif 0<=ans<=x:
    print('safe')
else:
    print('delicious')
# Judge status: Accepted
import fractions
n, y = map(int,input().split())
x = list(map(int,input().split()))

x.append(y)
x.sort()
d = []
for i in range(n):
    d.append(x[i+1]-x[i])
if len(d) !=1:
    ans = fractions.gcd(d[0],d[1])
    for i in range(n-1):
        ans = fractions.gcd(ans,d[i])
    print(ans)
else:
    ans = d[0]
    print(ans)
# Judge status: Accepted
import math
from collections import defaultdict,deque
#from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

n=ii()
a=ll()
lol=[]
lol.append(a[0])
for i in range(1,n-1):
    lol.append(min(a[i-1],a[i]))
lol.append(a[n-2])
print(sum(lol))
# Judge status: Wrong Answer
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
hoge = [x for x in range(arr[0], arr[-1]+1)]
if len(arr) == 1:
    print(0)
    exit()

a = hoge[len(hoge)//2]
b = hoge[len(hoge)//2-1]

min_cost = 1 << 60
cost = 0
for i in arr:
    cost += (i-a)**2
min_cost = min(min_cost, cost)

for i in arr:
    cost += (i-b)**2
min_cost = min(min_cost, cost)

print(min_cost)
# Judge status: Accepted
N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print(dp[N])
# Judge status: Accepted
S = list(input())
flag = 1
if "S" in S:
  if not("N" in S):
    flag = 0
if "N" in S:
  if not("S" in S):
    flag = 0
if "E" in S:
  if not("W" in S):
    flag = 0
if "W" in S:
  if not("E" in S):
    flag = 0
if flag:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a, b = map(int, input().split())
if a * b % 2 == 1:
    print('Odd')
else:
    print('Even')
# Judge status: Accepted
s = input()
nums = s.split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
d = int(nums[3])
print(max(a*c,a*d,b*c,b*d))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = sorted(A)
ans1 = B[N // 2 - 1]
ans2 = B[N // 2]
for i in range(N):
    if A[i] > ans1:  print(ans1)
    else:  print(ans2)
# Judge status: Accepted
import math

X = int(input())
Y = X/2
print(math.ceil(Y))
# Judge status: Accepted
sa = list(input())
sb = list(input())
sc = list(input())
n = "a"
while True:
    if n == "a":
        if len(sa) == 0:
            print ("A")
            exit ()
        n = sa.pop(0)
    elif n == "b":
        if len(sb) == 0:
            print ("B")
            exit ()
        n = sb.pop(0)
    else:
        if len(sc) == 0:
            print ("C")
            exit ()
        n = sc.pop(0)
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))
count = 0
flag = True
for i in range(n):
    if p[i] != i+1:
        index = n-i-1
        if p[index] == n-i:
            count += 1
        else:
            flag = False
            break

if flag:
    if count <= 1:
        print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
def resolve():
    L = int(input())
    ans = float(0)
    for x in range(1, L):
        for y in range(1, L-x):
            x = float(x)
            y = float(y)
            z = float(L) - x - y
            ans = max(ans, x*y*z)

    print(ans)
if __name__ == '__main__':
    resolve()
# Judge status: Accepted
a, b = map(int, input().split())

print((a + b) % 24)
# Judge status: Wrong Answer
s = list(input())
n = len(s)

lst = []
lst.append(s[0])
i = 1
while i < n:
	if s[i-1] != s[i]:
		lst.append(s[i])
		i += 1
	else:
		lst.append(s[i-1] + s[i])
		i += 2

print(len(lst))
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
ans = [0]*201
for a in A:
  for i in range(201):
    ans[i] += (i-100 - a)**2
print(min(ans))
# Judge status: Accepted
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

n = int(input())
a = list(map(int,input().split()))
c = collections.Counter(a)
li2 = [0,0]
li4 = [0]
for key,value in c.items():
    if value>=4:
        li4.append(key)
    elif value>=2:
        li2.append(key)
li2.sort()
li4.sort()
ans1 = li2[-1]*li2[-2]
ans2 = li4[-1]**2
ans3 = li4[-1]*li2[-1]
ans = max(ans1,ans2)
ans = max(ans,ans3)
print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
if n % k == 0:
    print(0)
else:
    print(1)
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))

A = []

for i in range(N):
  A.append([a[i],i+1])
  
A.sort()

for j in range(len(A)):
  print(A[j][1],end =' ')
# Judge status: Accepted
#A
alpha = input()
large = ["A","B","C","D","E","F","G","H","I","J","K","L","M",
         "N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
if alpha in large:
    print("A")
else:
    print("a")
# Judge status: Accepted
N, K= map(int,input().split())
p = list(map(int,input().split()))

e = [(pi+1)/2 for pi in p]

f = sum(e[:K])
ans = f

for i in range(K,N):
    f = f - e[i-K] + e[i]
    ans = max(ans,f)

print(ans)
# Judge status: Accepted
n = int(input())
A = sorted(map(int, input().split()))
diff = float("inf")
ans = 0
for a in A[:-1]:
    d = abs(a - A[-1] / 2)
    if d < diff:
        ans = a
        diff = d
print(A[-1], ans)
# Judge status: Accepted
S=input();T=input()
N=len(S);NP=len(T);M=len(T)
for i in range(N-M+1):
  cnt=0
  for j in range(M):
    if T[j]==S[j+i]:cnt+=1
  if NP>M-cnt: NP=M-cnt
print(NP)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

num_four = 0
num_two = 0
num_odd = 0
for i in range(N):
    if A[i] % 4 == 0:
        num_four += 1
    elif A[i] % 2 == 0:
        num_two += 1
    else:
        num_odd += 1

# print(num_four, num_two, num_odd)

v = num_four * 2 + 1
if num_two >= 2:
    v += num_two
ans = 'Yes' if v >= N else 'No'
print(ans)

# 2 2 2 2 o 4 o 4 o 4 ... o 4 o
# Judge status: Accepted
step,pay,gain=map(int,input().split())
b=step-pay+1
print(max(step+1,pay+b//2*(gain-pay)+b%2))
# Judge status: Accepted
q,h,s,d = map(int, input().split())
n = int(input())

ans = 0

print(min(q * 8, h * 4, s * 2, d) * (n // 2)+min(q * 4, h * 2, s) *(n%2==1))
# Judge status: Accepted
X =int(input())
b =False
for x in range(-1000,1000):
    for y in range(-1000,1000):
        if (x**5)-(y**5)==X:
            print(x,y)
            b=True
    if b==True:
        break
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

# Input
s = [input() for i in range(2)]
NK = list(s[0].split())
HI = list(s[1].split())
HI.sort(reverse=True)

# Proccess
survibe_monster = int(NK[0])-int(NK[1])
killed_monster = int(NK[1])

del HI[:killed_monster]

how_many_attack = 0
for i in range(survibe_monster):
  how_many_attack = how_many_attack + int(HI[i])

# Output                   
print(how_many_attack)
# Judge status: Accepted
y, m, d = map(int, input().split("/"))
if m < 4:
    print("Heisei")
elif m == 4 and d <= 30:
    print("Heisei")
else:
    print("TBD")
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
print("Yes" if max(l) < sum(l) - max(l) else "No")
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
l = []
for i in range(n):
    p[i] -= 1
    if p[i] != i:
        l.append([i, p[i]])
if len(l) == 0:
    print('YES')
elif len(l) == 2 and l[0][1] == l[1][0] and l[0][0] == l[1][1]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
from itertools import accumulate
N, K = map(int, input().split())
A = list(map(int, input().split()))


def calc_imos(arr):
    imos = [0] * (N + 1)
    for i, a in enumerate(arr):
        l = max(0, i - a)
        r = min(N - 1, i + a)
        imos[l] += 1
        imos[r + 1] -= 1
    imos = list(accumulate(imos))
    return imos[:-1]


for k in range(min(50, K)):
    A = calc_imos(A)
print(*A, sep=' ')
# Judge status: Wrong Answer
import math
x, y = map(int, input().split())
print(int(math.log2(y/x-0.0001) + 1))
# Judge status: Wrong Answer
N = int(input())
S = [int(input()) for _ in range(N)]
S.sort()
res = sum(S)
i = 0
while i < N and res % 10 == 0:
    res -= S[i]
    i += 1
print(res)
# Judge status: Accepted
N = int(input())
p = list(map(int, input().split()))

ans = 0
i = 1
while i <= N:
    if p[i - 1] == i:
        ans += 1
        i += 2
    else:
        i += 1

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

ans = 10**9

for i in range(0, 101):
    tmp = 0
    for x in X:
        tmp += (x - i)**2
    ans = min(tmp, ans)

print(ans)
# Judge status: Accepted
import math
n=int(input())
print(int(n*360/math.gcd(n,360)/n))
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(n+1):
  ans += i
print(ans)
# Judge status: Accepted
import heapq

n = int(input())
a = [int(i) for i in input().split()]
q = int(input())
bc = [[int(i) for i in input().split()] for j in range(q)]

dp = [0 for _ in range(100001)]

for i in a:
    dp[i] += 1

total = sum(a)

for i in range(q):
    total += (bc[i][1] - bc[i][0]) * dp[bc[i][0]]
    print(total)
    dp[bc[i][1]] += dp[bc[i][0]]
    dp[bc[i][0]] = 0
# Judge status: Accepted
a,b,n = map(int,input().split())
def floor(a,b,x):
    return a*x//b - a*(x//b)

if n < b:
    print(floor(a,b,n))
else:
    print(floor(a,b,b-1))
# Judge status: Accepted
n = int(input())
a = [int(input()) for i in range(n)]
sorted_list = sorted(a, reverse=True)
a_max = sorted_list[0]
a_sec = sorted_list[1]
for i in range(n) :
    if a[i] != a_max :
        print(a_max)
    else :
        print(a_sec)
# Judge status: Accepted
#!/usr/bin/env python

def main():
    n, m = map(int, input().split())

    ret = n * (n - 1) // 2
    ret += m * (m - 1) // 2

    print(ret)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))

ls = [0]*n
sum = 0
for i in range(n):
  ls[i] = l[i] - (i+1)

ls.sort()
med = ls[n//2]

for i in ls:
  sum += abs(i - med)
print(sum)
# Judge status: Accepted
n,*a=map(int,open(0).read().split());t=sum(a);v=w=1
print(sum([1]+[exit(print(-1)) if(w:=min(2*(w-q),t:=t-q))<0 else w for q in a]))
# Judge status: Wrong Answer
def main():
    MOD = 10 ** 9 + 7

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

    if (X + Y) % 3:
        print(0)
        return

    a = (X * 2 - Y) // 3
    b = X - a * 2

    def choose(n, a, mod):
        x, y = 1, 1
        for i in range(a):
            x = x * (n - i) % mod
            y = y * (i + 1) % mod
        return x * pow(y, mod - 2, mod) % mod

    ans = choose(a + b, min(a, b), mod=MOD)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
from itertools import permutations


def main():
    grid = []
    num_sum = 0
    for _ in range(3):
        tmp = list(map(int, input().split(" ")))
        num_sum += sum(tmp)
        grid.append(tmp)
    num_sum //= 3
    index_list = permutations([0, 1, 2])
    answer = "Yes"
    for index in index_list:
        if not grid[0][index[0]] + grid[1][index[1]] + grid[2][index[2]] == num_sum:
            answer = "No"
            break
    print(answer)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
A = [int(a) for a in input().split()]

cnt = 0
c2 = 0
c4 = 0
for a in A:
    if a%4 == 0:
        c4 += 1
    elif a%2 == 0:
        c2 += 1
    else:
        cnt += 1

if c4 >= cnt or (c2 == 0 and c4+1 == cnt):
    ans = "Yes"
else:
    ans = "No"
print(ans)
# Judge status: Accepted
a, b, c = map(int,input().split())

if a + b < c:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

#累積和
B = [0]*N
for _ in range(K):
    for i in range(N):
        l = max(0,i-A[i])
        r = min(N-1, i+A[i])
        B[l] += 1
        if r+1 < N: B[r+1] -= 1
    A[0] = 0
    for i in range(1,N):
        A[i] = 0
        B[i] += B[i-1]
    if min(B) == N: break
    B, A = A, B

print(*A)
# Judge status: Accepted
n = int(input())
dp = [[0 for _ in range(3)] for _ in range(n)]

dp[0][0],dp[0][1],dp[0][2] = map(int,input().split())

for i in range(1,n):
    abc = map(int,input().split())
    for j,v in enumerate(abc):
        for k in range(3):
            if j != k:
                dp[i][j] = max(dp[i][j],dp[i-1][k] + v)

print(max(dp[n-1]))
# Judge status: Wrong Answer
nums = [int(e) for e in input().split()]

if nums[2]%nums[1] == 0:
    A = nums[2]%nums[1]
else:
    A = nums[2]%nums[1] + 1

if nums[0]%nums[3] == 0:
    T = nums[0]%nums[3]
else:
    T = nums[0]%nums[3] + 1
 
if A <= T:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = input()
m = N.upper()
if N == m:
  print('A')
else:
  print('a')
# Judge status: Wrong Answer
s = input().split()
n = int(s[0])
s = input().split()
d = [0]*n
print(d)
for i in s:
    d[int(i)-1]+=1

for i in range(n):
    print(d[i])
# Judge status: Accepted
w, h, x, y = map(int, input().split())
str1 = f'{w * h / 2:.09f}'
str2 = '1' if w == x * 2 and h == y * 2 else '0'
print(' '.join([str1,str2]))
# Judge status: Accepted
r = int(input())
print(r ** 2)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
l.sort()
print(l[n//2]-l[n//2-1])
# Judge status: Accepted
s=input()
from collections import Counter
sc=Counter(s)
for a in sc:
    if sc[a]>(len(s)+2)//3:
        print("NO")
        exit()
print("YES")
# Judge status: Wrong Answer
S = list(input())

res = 0

for i in range(1, len(S)):
    if S[i] == S[i-1]:
        res += 1
        S[i] = "0" if int(S[i]) else "1"
        print("S")
print(res)
# Judge status: Accepted
import sys
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]
N,M=map(int,input().split())
c=M//N
L=make_divisors(M)
L=list(reversed(L))
for i in range(len(L)):
  if L[i]<=c:
    print(L[i])
    sys.exit()
# Judge status: Accepted
N = int(input())
shops = []
for i in range(N):
    S, P = input().split()
    shops.append([S, int(P), i+1])
shops.sort(key=lambda x: x[1], reverse=True)
shops.sort(key=lambda x: x[0])
for shop in shops:
    print(shop[2])
# Judge status: Accepted
N =int(input())
p = [list(map(int,input().split())) for _ in range(N)]

import itertools,math

ptr = list(itertools.permutations(range(N),N))

def dist(p1,p2):
  return math.sqrt((p1[0]-p2[0])**2+(p1[1]-p2[1])**2)

total = 0

for pt in ptr:
  for i in range(len(p)-1):
    total += dist(p[pt[i]] ,p[pt[i+1]])  
print(total/len(ptr))
# Judge status: Accepted
n,k,*a=map(int,open(0).read().split())
a=[0]+a
ans=1
while k:
  if k&1:
    ans=a[ans]
  a=[a[i] for i in a]
  k>>=1
print(ans)
# Judge status: Accepted
import math

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

xylist = [input() for i in range(N)]

cnt = 0

for xy in xylist:
  x = int(xy.split()[0])
  y = int(xy.split()[1])
  xy2 = x*x + y*y
  len = math.sqrt(xy2)
  if len <= D:
    cnt = cnt + 1

print(cnt)
# Judge status: Accepted
s=input()
n=len(s)
a,b,c=s.count("a"),s.count("b"),s.count("c")
ma=max(a,b,c)
mi=min(a,b,c)
if ma-1<=mi:print('YES')
else:print('NO')
# Judge status: Accepted
N = int(input())

A = list(map(int,input().split()))
ans = 0

for i in range(1,N):
    if A[i] < A[i-1]:
        ans += A[i-1]-A[i]
        A[i] = A[i-1]
print(ans)
# Judge status: Wrong Answer
X = int(input())
total = 0

C = 0
D = 0

while True:
    if X > 500:
        C = X // 500
        P = 500 * C
        X = X - P
    elif X > 5:
        D = X // 5
        L = 5 * D
        X = X - L
    else:
        break

total = (1000 * C) + (5 * D)

print(total)
print()
# Judge status: Accepted
N,L=map(int,input().split())
S=[input() for i in range(N)]
s=sorted(S)
[print(i,end="") for i in s]
# Judge status: Wrong Answer
c =[[],[],[]]

c[0] = [int(x) for x in input().split(" ")]
c[1] = [int(x) for x in input().split(" ")]
c[2] = [int(x) for x in input().split(" ")]

a=[0,0,0]
b=[0,0,0]

result = "No"
cnt = 0

for i in range(0,3):
  for j in range(0,i):
    for a[i] in range(0,101):
      for b[j] in range(0,101):
        if c[i][j] == a[i]+b[j]:
          cnt +=1
                    
if cnt == 6:
  result = "Yes"
  
print(result)
# Judge status: Accepted
from collections import defaultdict
n=int(input())
s=["".join(sorted(input())) for _ in range(n)]

d = defaultdict(int)
for a in s:
  d[a]+=1
c=0
for a in d.values():
  if a>1:
    c+=a*(a-1)//2
print(c)
# Judge status: Accepted
def resolve():
    n = int(input())
    S = list(input())
    min_c = n
    count_e = S.count('E')
    count_w = 0

    for s in S:
        if s == 'E':
            count_e -= 1
        min_c = min(min_c, count_e + count_w)
        if s == 'W':
            count_w += 1

    print(min_c)

if __name__ == '__main__':
    resolve()
# Judge status: Accepted
N = int(input())

keihinList=set()

for i in range(N):
    keihinList.add(input())

print(len(keihinList) )
# Judge status: Accepted
N = int(input())
S = list(input())
cnt = [0]
for i in range(N):
    S1 = set(S[:i+1])
    S2 = set(S[i+1:])
    cnt.append(len(S1&S2))
max_cnt=max(cnt)
print(max_cnt)
# Judge status: Accepted
n,k=map(int,input().split())
mod=10**9+7
ans=0
for i in range(k,n+2):
    ans+=i*(2*n-i+1)//2-i*(i-1)//2+1

print(ans%mod)
# Judge status: Accepted
s = input()
k = int(input())

for i in range(len(s)):
    if s[i] != "a":
        req = ord("z") - ord(s[i]) + 1

        if req <= k:
            k -= req
            s = s[:i] + "a" + s[i+1:]

if k > 0:
    s = s[:-1] + chr(ord(s[-1]) + k%26)

print(s)
# Judge status: Accepted
def resolve():
    w, a, b = map(int, input().split())

    a1 = a
    a2 = a + w

    b1 = b
    b2 = b + w

    ans = 0
    if a2 < b1:
        ans = b1 - a2
    elif b2 < a1:
        ans = a1 - b2
    else:
        ans = 0
    
    print(ans)

resolve()
# Judge status: Accepted
N = int(input())
print((N-1)*N//2)
# Judge status: Wrong Answer
S = input()
T = input()

add = len(T)
#print(add)
if len(S) > 10 or len(S) < 2:
  print("No")
  exit()

if S != T[:int(len(T)-1)]:
  print("No")
  exit()
if len(S)+1 != len(T):
  print("No")
  exit()
for i in range(len(T)):
  if T[i] not in "abcdefghijklmnopqrstuvwxyz":
    print("No")
    exit()
  else:
    pass

print("yes")
# Judge status: Accepted
a,b,n=map(int,input().split())
x=min(b-1,n)
print((a*x)//b)
# Judge status: Wrong Answer
k=int(input())
a,b =map(int,input().split())

adiv =a//k


if k*(adiv+1)<=b:
   print('OK')
elif b%k==0 : 
    print('OK')
else:
    print('NG')
# Judge status: Wrong Answer
A=int(input())
B=int(input())
C=int(input())
X=int(input())

count=0

for i in range(A):
    for j in range(B):
        for k in range(C):
            if 500*A+100*B+50*C==X:
                count+=1
            else:
                pass
print(count)
# Judge status: Wrong Answer
print(float(input()) / 3 ** 3)
# Judge status: Accepted
N = int(input())

if((N-1)%2==0):
    print(N*((N-1)//2))
else:
    print(N*((N-1)//2) + N//2 )
# Judge status: Accepted

n = int(input())
s = input()
if len(s) <= n:
    print(s[:n])
else:
    print(s[:n]+"...")
# Judge status: Accepted
A, B = map(int, input().split())
if A <= 8 and B <= 8:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
x = input().replace("ST", "")
s = 0
cnt = 0
for i in range(len(x)):
    if x[i] == "S": s += 1
    else:
        if s > 0: 
            s -= 1
            cnt += 1
print(len(x)-cnt*2)
# Judge status: Accepted

import math
N, M = map(int, input().split())

if abs(N-M) >= 2:
  print(0)
  exit()

if N == M:
  print((math.factorial(N) * math.factorial(M)) * 2 % (10**9 + 7))
else:
  print((math.factorial(N) * math.factorial(M)) % (10**9 + 7))
# Judge status: Wrong Answer
n,k= list(map(int, input().strip().split()))
a = list(map(int, input().strip().split()))
b=[1]*n
for j in range(0,k):
        b[k-1]*=a[j]
for i in range(k+1,n+1):
    b[i-1]*=b[i-2]*a[i-1]//a[i-k-1]
print(b)
    

for i in range(k,n):
    if b[i-1]<b[i]:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
n=int(input())
import math
print(math.ceil(n/2)/n)
# Judge status: Wrong Answer
import heapq
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(N)]
earn = 0
AB.sort(key=lambda x:x[0])
pos=0
cando=[]
for remain in range(M+1):
    for i in range(pos,len(AB)):
        if AB[i][0] <= remain:
            heapq.heappush(cando, -AB[i][1])
        else:
            pos=i
            break
    if cando:
        earn-=heapq.heappop(cando)
print(earn)
# Judge status: Accepted
n,m,k = map(int,input().split())

able_set = set()
for ni in range(n+1):
  base = ni * m
  for mi in range(m+1):
    black = base - ni*mi + (n-ni)*mi    
    able_set.add(black)    
    
if k in able_set:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a = int(input())

if a==1:
    print(1)
    exit()

res = 1
for i in range(2,32):
    for j in range(2,10):
        x = i**j
        if x > a:
            pass
        else:
            res = max(res,x)
print(res)
# Judge status: Wrong Answer
import bisect
n=int(input())
l=list(map(int,input().split()))
l.sort()

ans=0
for a in range(n):
    for b in range(a+1,n):
        ans+=bisect.bisect_right(l,l[a]+l[b])-b
        
print(ans)
# Judge status: Wrong Answer
from collections import deque

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

dist = [-1]*n
que = deque()
dist[0]=0
que.append(0)
while len(que):
    v = que.pop()
    for node in G[v]:
        if dist[node]==-1:
            dist[node]=dist[v]+1
            que.append(node)

if dist[-1]==1 or dist[-1]==2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
import collections
n=int(input())
num=[]
l=[]
count=0
for _ in range(n):
    a=int(input())
    l.append(a)
l=collections.Counter(l)
for i in l.values():
    if i%2!=0:
        count+=1
print(count)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a==b:
    print('Draw')
elif a > b and b != 1:
    print('Alice')
else:
    print('Bob')
# Judge status: Accepted
s = input()
s += input()

print("YES" if s == "".join(reversed(s)) else "NO")
# Judge status: Accepted
a,b,c=map(int,input().split())
s=[a,b,c]
s=list(set(s))
print(len(s))
# Judge status: Wrong Answer
N = int(input())
s = [int(input()) for i in range(N)]
s.sort()
ans = sum(s)
if ans % 10 != 0:
  print(s)
  exit()
else:
  for i in s:
    if i % 10 != 0:
      print(ans-i)
      exit()
print(0)
# Judge status: Accepted
a,b = map(int,input().split())
s = input()
S = list(s)
c = 0
for i in S:
    if i == "-":
        c += 1
        if c > 1:
            print("No")
            exit()
            
if s.isdecimal() is True:
    print("No")
    exit()
    
if len(s) != a + b + 1:
    print("No")
    exit()
    
if s[:a].isdecimal() is True and S[a] == "-":
    print("Yes")
    
else:
    print("No")
# Judge status: Wrong Answer
K = int(input())
a = K // 2
b = K // 2 + 1
print(a * b)
# Judge status: Accepted
N = int(input())
xl = []
for i in range(N):
    x, l = map(int, input().split())
    xl.append((x, l))
xl.sort()

kept = []
cur = 0
for i in range(1, N):
    x_cur, l_cur = xl[cur]
    x_next, l_next = xl[i]
    if x_cur + l_cur <= x_next - l_next:
        kept.append(cur)
        cur = i
    elif x_cur + l_cur > x_next + l_next:
        cur = i
kept.append(cur)

print(len(kept))
# Judge status: Wrong Answer
n,k=map(int,input().split())
l=list(map(int,input().split()))
if l[0]<=0 and l[k-1]<=0:
  print(abs(l[0]))
elif l[0]>=0 and l[k-1]>=0:
  print(l[k-1])
else:
  mi=min(l[k-1],abs(l[0]))
  ma=max(l[k-1],abs(l[0]))
  print(mi*2+ma)
# Judge status: Wrong Answer
s = list(input())

for i in s:
    if i == 'A':
        a = s.index(i)
        break
for i in s:
    if i == 'Z':
        z = s.index(i)
print(z-a+1)
# Judge status: Wrong Answer
from collections import Counter
MOD = 10**9 + 7
N = int(input())
S = input()
count_si = Counter(S)
ans = 1
for v in count_si.values():
    print(v)
    ans = (ans * (v+1)) % MOD

print((ans-1)%MOD)
# Judge status: Accepted
r = int(input())
pi = 3.1415927
print(2 * pi * r)