peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def resolve():
  a, b, c, d = input()
  for i in range(8):
    q = str(a)
    if (i>>0) & 1:
      q += '+'
    else:
      q += '-'
    q += str(b)
    if (i>>1) & 1:
      q += '+'
    else:
      q += '-'
    q += str(c)
    if (i>>2) & 1:
      q += '+'
    else:
      q += '-'
    q += str(d)

    if eval(q) == 7:
      q += '=7'
      print(q)
      return

  return

if __name__ == "__main__":
  resolve()
# Judge status: Accepted
import math
a,b,x=map(int,input().split())
t=a*b*b/2/x if 2*x<a*a*b else 2/a*(b-x/a/a)
print(math.degrees(math.atan(t)))
# Judge status: Accepted
n = int(input())
sum = 0
for i in range(n+1):
    sum = sum + i
    
print(sum)
# Judge status: Accepted
_ = input()
S = input().lstrip('.').rstrip('#')
n = len(S)

x = 0
y = S.count('.')
c = min(n-y, y)
for i in range(n):
  t = S[i]=='#'
  x += t
  y -= 1-t
  c = min(c, x+y)
print(c)
# Judge status: Wrong Answer
n = int(input())
a = list(int(x) for x in input().split() if int(x)%2==0)
ok = True
for i in a:
  if i%3!=0 and i%5!=0:
    print('DENIED')
    ok = False
if ok:
  print('APPROVED')
# Judge status: Accepted
from collections import deque
n, m = map(int, input().split())
ab = [[] for i in range(n+1)]

for i in range(m):
    a, b = map(int, input().split())
    ab[a].append(b)
    ab[b].append(a)

ans = [-1]*(n+1)
que = deque([1])
while que:
    q = que.popleft()
    for i in ab[q]:
        if ans[i] == -1:
            que.append(i)
            ans[i] = q
print('Yes')
for i in range(2, n+1):
    print(ans[i])
# Judge status: Accepted
S_list = list(input())

ans = 0

for i in range(len(S_list) // 2):
    if S_list[i] != S_list[-i - 1]:
        ans += 1

print(ans)
# Judge status: Accepted
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
else:
    print((h*w)//2 + (h*w)%2)
# Judge status: Accepted
import numpy as np

N, W = map(int, input().split())
dp = np.zeros(W+1)
for i in range(N):
    w, v = map(int, input().split())
    dp[w:] = np.maximum(dp[w:], dp[:-w] + v)

print(int(dp.max()))
# Judge status: Accepted
N = int(input())
dp = [i for i in range(N+1)]
 
for i in range(1, 7):
    for j in range(9**i, N+1):
        dp[j] = min(dp[j], dp[j-9**i]+1)
for i in range(1, 7):
    for j in range(6**i, N+1):
        dp[j] = min(dp[j], dp[j-6**i]+1)
print(dp[N])
# Judge status: Wrong Answer
N = []
N.append(input())

print("AC" + " x "+ str(N.count("AC")))
print("WA" + " x "+ str(N.count("WA")))
print("TLE" + " x "+ str(N.count("TLE")))
print("RE" + " x "+ str(N.count("RE")))
# Judge status: Wrong Answer
n,m=map(int,input().split())
l=[0]*m
r=[0]*m
for i in range(m):
    l[i],r[i]=map(int,input().split())
if max(l)<=min(r):
    print(0)
else:
    print(min(r)-max(l)+1)
# Judge status: Wrong Answer
n=int(input())
print(n*(n+1)%2)
# Judge status: Accepted
s = list(input())
k = int(input())

for i in range(len(s)):
    a = 26-(ord(s[i])-97)
    # print(ord(s[i]))
    # print(a)
    if k >= a and a != 26:
        k -= a
        s[i] = "a"
# print(k)
s[-1] = chr(ord(s[-1]) + k % 26)
# print(ord(s[-1]))
print("".join(s))
# Judge status: Accepted
N = int(input())
D = list(map(int, input().split()))

if D[0] != 0:
    print(0)
    exit()

c = {}
for i in D:
    c.setdefault(i, 0)
    c[i] += 1

if c[0] != 1:
    print(0)
    exit()

result = 1
for i in range(1, max(D) + 1):
    if i not in c:
        print(0)
        exit()
    result *= pow(c[i - 1], c[i], 998244353)
    result %= 998244353
print(result)
# Judge status: Wrong Answer
#!/usr/bin/env python3
# coding=utf-8

import sys

n = int(sys.stdin.readline().strip())

txy = [tuple(map(int, l.strip().split(" "))) for l in sys.stdin.readlines()]
check_txy = [abs(_x) + abs(_y) <= _t and (_t + _x + _y) % 2 == 0 for (_t, _x, _y) in txy]
if all(check_txy):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
O = input()
E = input()
Olen = len(O)
Elen = len(E)
password = ''
for i in range(min(Olen, Elen)):
    password += O[i] + E[i]
if Olen != Elen:
    password += O[-1]
print(password)
# Judge status: Accepted
n=int(input())
s=[int(input()) for i in range(n)]
t=sum(s)
if t%10!=0:
  print(t)
else:
  s.sort()
  a=1
  for i in range(n):
    if s[i]%10!=0:
      print(t-s[i])
      a=0
      break
  if a:
    print(0)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
i = 0
ret = 1
while i < N-1:
  while i < N-1 and A[i] == A[i+1]:
    i += 1
    continue
  if A[i] < A[i+1]:
    while i < N-1 and A[i] <= A[i+1]:
      i += 1
    if i < N-1:
      ret += 1
    continue
  elif A[i] > A[i+1]:
    while i < N-1 and A[i] >= A[i+1]:
      i += 1
    if i < N-1:
      ret += 1
    continue
print(ret)
# Judge status: Accepted
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and (s[1:s.find('C')]+s[s.find('C')+1:]).islower():
    print('AC')
else:
    print('WA')
# Judge status: Accepted
s = input()
for i in range((len(s) >> 1) - 1, -1, -1):
    n = i << 1
    if s[:i] == s[i:n]:
        print(n)
        break
# Judge status: Accepted
n, m, x = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(n)]
ans = []
for i in range(2 ** n):
    price = 0
    und = [0 for _ in range(m)]
    for j in range(n):
        if (i >> j) & 1:
            price += c[j][0]
            for k in range(m):
                und[k] += c[j][k+1]
    if all(und[i] >= x for i in range(m)):
        ans.append(price)
 
if ans == []:
    print(-1)
else:
    print(min(ans))
# Judge status: Accepted
n=int(input())
print(int((n**.5))**2)
# Judge status: Wrong Answer
string = input()
index_of_A = string.index("A")
index_of_Z = string.index("Z", index_of_A)

print(index_of_Z - index_of_A + 1)
# Judge status: Accepted
N = int(input())

if N % 1000 == 0:
  print("0")
elif N < 1000:
  print(1000-N)
else:
  n = list(str(N))
  print(1000*(1+int(n[0]))-N)
# Judge status: Accepted
n = int(input())

m = range(1,n + 1)

a = range(1,n + 1,2)

b = len(a) / len(m)
print(b)
# Judge status: Wrong Answer
s = list(input())

s = set(s)

if len(s) % 2 == 1:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
s=int(input())
x=s
list=[]
for i in range(1000000000000000000):
    y=x%(-2)
    if y == -1:
        x = (x-1)//(-2)
        y = 1
    else:
        x=x//(-2)
    list.insert(0, y)
    if x == 0:
        print(*list, sep="")
        break
# Judge status: Wrong Answer
L=int(input())
L1=(L//3)
L2=L%3
while L2>=10**-8:
    L1+=(L2/3)
    L2=(L2/3)

print(L1**3)
# Judge status: Wrong Answer
a,b,x = map(int,input().split())
print('YES' if x <= a+b else 'NO')
# Judge status: Wrong Answer
A,B = map(int,input().split())
if (A+B)%3==0:
  print("Possible")
else:
  print("Impossible")
# Judge status: Wrong Answer
import sys
import heapq
from decimal import Decimal

input = sys.stdin.readline

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

tmp = 0
flag = False

for h in h_list:

    if tmp == 0:
        tmp = h
        continue

    if tmp > h:
        tmp = h
        if flag:
            print("No")
            exit(0)
        else:
            flag = True
    else:
        tmp = h
        flag = False

print("Yes")
# Judge status: Accepted
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    N,=pin()
    AB=[tupin() for _ in range(N)]
    AB.sort(key=lambda x:x[1])
    #print(AB)
    time=0
    for i in range(N):
        time+=AB[i][0]
        if time>AB[i][1]:
            print("No")
            return
    print("Yes")
        
#%%submit!
resolve()
# Judge status: Accepted
from collections import Counter

S = input()

x = [0]
dec = 1
for s in S[::-1] :
  x.append((x[-1] + dec * int(s)) % 2019)
  dec *= 10
  dec %= 2019

ret = 0
for v in Counter(x).values() :
  ret += v * (v - 1) // 2
print(ret)
# Judge status: Accepted
N,K=map(int,input().split())
A=list(map(int,input().split()))
a=N-K+1
long=10**9
for i in range(a):
  l=A[i+K-1]-A[i]+min(abs(A[i+K-1]),abs(A[i]))
  long=min(long,l)
print(long)
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))
cnt = 0
for i in range(n-2):
    c = [p[i], p[i+1], p[i+2]]
    cs = sorted(c)
    if c[1] == cs[1]:
       cnt += 1
print(cnt)
# Judge status: Accepted
s=int(input())
from collections import Counter
cc=Counter()
cc[s]=1
cnt=1
while True:
    if s%2==0:
        s=s/2
    else:
        s=3*s+1
    cnt+=1
    if cc[s]>0:
        print(cnt)
        import sys
        sys.exit()
    cc[s]+=1
# Judge status: Accepted
if __name__ == "__main__":
    x = int(input())

    for i in range(100000):
        if i * (i+1) / 2 >= x:
            print(i)
            exit()
# Judge status: Wrong Answer
num = int(input())
text = input()
movedText = ""
for i in text:
  if i == "z" or i == "Z":
    movedText += chr(ord(i) - 25 + num)
    continue
  movedText += chr(ord(i) + num)
print(movedText)
# Judge status: Wrong Answer
n = int(input())
a = [int(i) for i in input().split()]
out = []
for i in range(n):
    out.append(a.index(n-i))
print(reversed(out))
# Judge status: Wrong Answer

N = int(input())

s = str(N)

if s in '7':
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys

N = int(input())
items = []
for i in range(N):
  item = input()
  items.append(item)

if(len(items) != len(set(items))):
  print('No')
  sys.exit()

for i in range(len(items)):
  if(i != 0 and items[i][0] != items[i-1][-1]):
    print('No')
    sys.exit()

print('Yes')
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
d = {}
for i in range(1,n+1):
        d[i] = 0

for i in range(len(a)):
    d[a[i]] += 1

for i in range(1,n+1):
    print(d[i])
# Judge status: Accepted
from collections import deque
d = deque()
d.extend(list(input()))
q = int(input())
z = 0
F = ""
R = ""
for i in range(q):
    a = tuple(input().split())
    if a[0] == "1":
        z += 1
        z %= 2
    else:
        if (int(a[1]) + z) % 2 == 0:
            d.append(a[2])
        else:
            d.appendleft(a[2])

ans = "".join(d)
if z % 2 == 0:
    print(ans)
else:
    print(ans[::-1])
# Judge status: Wrong Answer
import math

A, B, H, M = [int(i) for i in input().split(' ')]

A_theta = 360 / 12 * H
B_theta = 360 / 60 * M

theta = B_theta - A_theta

print(theta)
cos = math.cos(math.radians(theta))

print(cos)

dist = math.sqrt(A ** 2 + B ** 2 - A * B * cos)

print(dist)
# Judge status: Accepted
n = int(input())
d = [list( map( int, input().split() ) ) for i in range(n)]

for i in range(n-2):
  if d[i][0] == d[i][1]:
    if d[i+1][0] ==d[i+1][1]:
      if d[i+2][0] == d[i+2][1]:
        print('Yes')
        exit()
print('No')
# Judge status: Wrong Answer
x = [int(x) for x in input().split()]

ans = x[0]
x[3] -= x[0] + x[1]
if x[3] >= 0:
    ans -= x[3]

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
var = [0]*8
clown = 0
for i in a:
  if i >= 3200:
    clown += 1
  else:
    var[i//400] = 1
if sum(var) > 0:
  print(sum(var), sum(var)+clown)
else:
  print(1, sum(var)+clown)
# Judge status: Accepted
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra

n,x,y=map(int,input().split())

fr,to,w=[],[],[]

for i in range(n-1):
  fr.append(i)
  to.append(i+1)
  w.append(1)

fr.append(x-1)
to.append(y-1)
w.append(1)

g=csr_matrix((w, (fr, to)), shape=(n, n))
d=dijkstra(g,directed=False).astype(int)

ans_l=np.bincount(d.ravel(), minlength=n)//2

print(*ans_l[1:], sep='\n')
# Judge status: Wrong Answer
x, y = map(int, input().split())
count = 0
if x == y:
    print(0)
elif x == -y:
    print(1)
elif abs(y) > abs(x):
    if y > 0:
        if x > 0:
            print(abs(x-y))
        else:
            print(abs(x-y) + 1)
    else:
        print(abs(x-y) + 2)
else:
    if y > 0:
        print(abs(x-y) + 1)
    else:
        print(abs(x-y))
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    l=[input() for i in range(5)]
    sum=0
    for j in range(5):
        sum+=(int(l[j])//10)*10
    num=9
    for n in range(5):
        if int(l[n][-1])!=0 and int(l[n][-1]) < num:
            num=int(l[n][-1])
    sum-=10-num
    for s in range(5):
        if int(l[s])%10!=0:
            sum+=10
    print(sum)
resolve()
# Judge status: Accepted
N=int(input())
A=[]
for i in range(N):
  A.append(input())
a=set(A)
print(len(a))
# Judge status: Accepted
X, Y = map(int, input().split())

if (Y - 2*X) % 2 == 0 and X- (Y-2*X)/2 >= 0 and Y - 2*X >= 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from collections import Counter


def ok(n, D):
    # Dに含まれる数字をnで使っていたらFalse
    counter = Counter(str(n))
    for d in D:
        if counter[str(d)] > 0:
            return False
    return True


def main():
    N, K = list(map(int, input().split(' ')))
    D = list(map(int, input().split(' ')))
    while not ok(N, D):
        N += 1
    print(N)



if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b = map(int, input().split())
if a%b == 0:
  print(0)
else:
  print(1)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
S = sum(A)
S2 = sum(map(lambda x: x*x%mod,A))
ans = ((S*S - S2)/2)%mod
print(int(ans))
# Judge status: Accepted
#!/usr/bin/env python3
s = input()
abc_cnt = [s.count("a"),s.count("b"),s.count("c")]
if max(abc_cnt) - min(abc_cnt) > 1:
    print("NO")
else:
    print("YES")
# Judge status: Wrong Answer
n, a, b = map(int, input().split())

ans = INF = 1 << 60

# 2で割って余り1ならすれ違わない
if (b - a) % 2 == 0:
    ans = (b - a) // 2

# 左で落ち合う
ans = min(ans, b - 1)

# 右で落ち合う
ans = min(ans, n - a)

print(ans)
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = []
lmax = 0
rmin = 10**6
for i in range(m):
    a.append(list(map(int,input().split())))
    if a[i][0] > lmax:
        lmax = a[i][0]
    if a[i][1] < rmin:
        rmin = a[i][1]
print(1+rmin-lmax)
# Judge status: Accepted
#A_Calc
A = int(input())
#計算
out = int(A + A**2 + A**3)
# 出力
print(out)
# Judge status: Accepted
l1 = [1,3,5,7,8,10,12]
l2 = [4,6,9,11]
l3 = [2]
a,b = map(int,input().split())
f = False
if a in l1 and b in l1:
  f = True
if a in l2 and b in l2:
  f = True
print("Yes" if f else "No")
# Judge status: Accepted
N = int(input())
S = list(input())
i = N/2

if N % 2 != 0:
    print("No")
    exit()
if S[:int(i)] == S[int(i):]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()

a = [0]* (len(s)+1)

for i in range(len(s)):
    if s[i] == '<':
        a[i+1] = a[i]+1

s = s[::-1]

for i in range(len(s)):
    if s[i] == '>':
        a[len(s)-i-1] = max(a[len(s)-i-1], a[len(s)-i]+1)


print(sum(a))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if 2*(a+b)>=c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    B = [0]*N
    for i in range(N)[::-1]:
        cur_sum = -B[i]
        for j in range(i, N, i+1):
            cur_sum += B[j]
        if cur_sum % 2 != A[i] % 2:
            B[i] = 1
    # print(B)
    ans = [i+1 for i, b in enumerate(B) if b]
    print(len(ans))
    if ans:
        print(*ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a,b=map(int,input().split())
A=[]
for i in range(1,1000):
    A.append((i*(i+1))//2)

for i in range(10*6):
    if (a+i) in A and (b+i) in A:
        print(i)
        exit()
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

Menu = [A,B,C,D,E]
ans = 0
mint = 9
maxt = 0

for i in Menu :
    ans += (i+9)//10
    maxt = max(i%10, maxt)
    if i%10 != 0 :
        mint = min(i%10, mint)

if maxt == 0 :
    ans = ans * 10
else :
    ans = ans * 10 - 10 + mint
print(ans)
# Judge status: Accepted
x,n = map(int, input().split())
p = list(map(int, input().split()))

ans = -1
i = 1

if x not in p:
    print(x)
    exit()

while ans == -1:
    temp = x -i
    if temp not in p:
        ans = temp
        break
    temp = x + i
    if temp not in p:
        ans = temp
        break
    i += 1

print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
Q, H, S, D = map(int, input().split())
N = int(input()) * 4
res = 0

res += (N // 8) * min(Q * 8, H * 4, S * 2, D)
N %= 8
res += (N // 4) * min(Q * 4, H * 2, S)
N %= 4
res += (N // 2) * min(Q * 2, H * 1)
N %= 2
res += N * Q
print(res)
# Judge status: Wrong Answer
import random
a=random.randint(1,10)
print(str(a+a*a+a*a*a))
# Judge status: Accepted
a, b, h = [int(input()) for i in range(3)]
print(int((a+b)*h/2))
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))
for _ in range(min(k,41)):
  b=[0]*(n+1)
  for i in range(n):
    l=max(0,i-a[i])
    r=min(n,i+a[i]+1)
    b[l]+=1
    b[r]-=1
  for i in range(n-1):
    b[i+1]+=b[i]
  a=b[:n]
print(*a)
# Judge status: Accepted
a, b, c = map(int, input().split())
print(max(0, b + c - a))
# Judge status: Accepted
import itertools

n,m,q = map(int,input().split())
num = [list(map(int,input().split())) for i in range(q)]

number = []
for i in range(m):
    number.append(i+1)
a = list(itertools.combinations_with_replacement(number,n))
length = len(a)
memo = [0] * length
ans = 0

for i in range(length):#組み合わせの数回す
    sum = 0
    for j in range(q):
       if a[i][num[j][1]-1] - a[i][num[j][0]-1]  == num[j][2]:
            sum += num[j][3]
    ans = max(sum,ans)
print(ans)
# Judge status: Wrong Answer
N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))

s = sum(S)
S.sort()
i = 0
while s != 0:
    if s % 10 != 0:
        break
    s -= S[i]
    i += 1
if s >= 0:
    print(s)
else:
    print(0)
# Judge status: Accepted
import numpy as np


def main():
    x = int(input())
    A = np.arange(-120, 120)
    a = A ** 5
    for i, a_1 in enumerate(a):
        for j, a_2 in enumerate(a):
            if a_1 - a_2 == x:
                print(A[i], A[j])
                return


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

ans = 0
s = 0

def mod(x):
    return int(x % int(1e+9 + 7))

for i in reversed(range(N-1)):
    s += A[i+1]
    s = mod(s)
    ans += A[i] * s

    ans = mod(ans) 

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

count = {}
for i in range(1, m + 1):
  count[i] = 0

for i in range(n):
  a = list(map(int, input().split()))
  for j in range(1, len(a)):
    count[a[j]] += 1

ans = 0
for k, v in count.items():
  if v == n:
    ans += 1

print(ans)
# Judge status: Wrong Answer
s = list(input())
n=int(input())
l = [input().split(" ") for _ in range(n)]

for i in range(n):
    if l[i][0]=='1':
        s=s[::-1]
    elif l[i][0]=='2':
        if l[i][1]==1:
            s = s+[l[i][2]]
        else:
            s.append(l[i][2])
print(''.join(s))
# Judge status: Accepted
s = list(input())
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
  print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
  print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[1]:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
def culcSum(n:int)->int:
    return n * culcDivisor(n)

def culcDivisor(n:int)->int:
    cnt = 0
    for idx in range(1, n+1):
        if n % idx == 0:
            cnt += 1

    return cnt

n :int = int(input())
ans = 0
for idx in range(1, n+1):
    ans += culcSum(n)

print(ans)
# Judge status: Wrong Answer
# from pprint import pprint
# import math
# import collections

# n = int(input())
s = input()
# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))

K = 'keyence'

if K in s:
    splitted = s.split(K)

    if len([spl for spl in splitted if len(spl) > 0]) > 1:
        print('NO')
    else:
        print('YES')
else:
    print('NO')
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

ans = []
count = 0
for j in range(N):
    if (j == N - 1):
        ans.append(count)
        count = 0
        break
    if (H[j] < H[j + 1]):
        ans.append(count)
        count = 0
        continue
    elif (H[j] >= H[j + 1]):
        count += 1

print(max(ans))
# Judge status: Wrong Answer
import math
import decimal
a,b,h,m = map(int,input().split())
long = m/60*360
short = h*30+(m/60*30)
kakudo = abs(long-short)
if kakudo > 180:
    kakudo -= 180 
dum = kakudo/180*3.141592653589793238462643
radi = math.cos(dum)
ans = a**2 + b**2 - (2*a*b*radi)
ans = ans ** (1/2)
print(ans)
# Judge status: Wrong Answer
n = int(input())
z = 1000000000
 
if n==z*z:
	print(z, 0, z, 0, 0, 0)
elif n > z:
    a = n//z
    b = n%z
    print(a+1, b, 0, z, 1, 0)
else:
    print(n, 0, 1, 1, 0, 0)
# Judge status: Wrong Answer
n = int(input())
lst = [list(map(int, input().split())) for _ in range(n)]

ans = 'No'

for line in lst:
    t, x, y = line
    if t < x + y:
        break
    if t % 2 == 0 and x + y % 2 != 0:
        break
    if t % 2 != 0 and x + y % 2 == 0:
        break
    
    if t - x - y % 2 == 0:
        ans = 'Yes'

print(ans)
# Judge status: Wrong Answer
s = input()

ans = "ABC"
if s == "ABC":
    print("ARC")

print(ans)
# Judge status: Wrong Answer
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7



def main():
    N, M = map(int, readline().split())
    path = [[] for _ in range(N+1)]
    for _ in range(M):
        a,b = map(int, readline().split())
        path[a].append(b)
        path[b].append(a)
    print(path[1])
    print(path[N])
    if set(path[1])&set(path[N]):
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')

if __name__ == '__main__':
    main()
# Judge status: Accepted
x = int(input())
a = x % 11
if a == 0:
    ans = (x // 11) * 2
elif a < 7:
    ans = (x // 11) * 2 + 1
else:
    ans = (x // 11) * 2 + 2
print(ans)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())

L = []; R = []
for _ in range(m):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)

maxL = max(L)
minR = min(R)

ans = max(0, minR-maxL+1)
print(ans)
# Judge status: Wrong Answer
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]

x, y = map(int,input().split())

if a.count(x) == a.count(y) or b.count(x) == b.count(y):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
from math import log

H = int(input())

print(sum(
    2 ** i
    for i in range(int(log(H, 2)) + 1)
))
# Judge status: Accepted
N, A, B = map(int, input().strip().split())

tmp = N // (A+B)
ans = tmp * A
remain = N - (tmp * (A+B))
if (remain >= A) :
    ans += A
    
else:
    ans += remain

print(ans)
# Judge status: Wrong Answer
import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))
b = np.array(list(map(int, input().split())))
ans = 0

for i in range(n-1):
  temp = sum(a[:i+1])+sum(b[i:n])
  ans = max(ans, temp)
print(ans)
# Judge status: Accepted
n=int(input())
a=sorted(list(map(int,input().split())))

def groupby():
    global a
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2

b=groupby()
ans=0
for i in b:
    if i[0]>i[1]:
        ans+=i[1]
    else:
        ans+=(i[1]-i[0])

print(ans)
# Judge status: Wrong Answer

X = input()
N = len(X)
l, r = 0, N
while l < N and X[l] == 'T':
    l += 1
while r > 0 and X[r-1] == 'S':
    r -= 1
s = X[l:r].count('S')
t = r - l - s
ans = N - min(s, t) * 2
print(ans)
# Judge status: Wrong Answer
H , N =  [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
twice = False

if len(A) <= N: 
    while(H>0):
        H = H - N 
        print(A)
        for i in A:
            if H == i:
                twice = True
if twice == True:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a = n % 15
my_result = n * 800 - (n - a) / 15
print(int(my_result))
# Judge status: Accepted
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
if abs(a-c)<=d:
  print("Yes")
elif abs(a-b)<=d and abs(b-c)<=d:
    print("Yes")
else:
  print("No")