peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
MOD = 1_000_000_007
def calc_combi(n,k):
    frac=1
    denomi=1
    for i in range(n-k+1,n+1):
        frac=frac*i%MOD
    for i in range(1,k+1):
        denomi=denomi*i%MOD
    return frac*pow(denomi,MOD-2,MOD)

n, a, b = map(int,input().rstrip().split())
nca = calc_combi(n,a)
ncb = calc_combi(n,b)
print((pow(2,n,MOD)-1-nca-ncb)%MOD)
# Judge status: Accepted
a, b = map(int, input().split())

x = sorted([a, b, a - 1, b - 1], reverse=True)

print(x[0] + x[1])
# Judge status: Accepted
n = int(input())
b = list(map(int,input().split()))
"""
b_i >= max(a_i, a_(i+1))
"""
a = [10**18 for _ in range(n)]
for i in range(n):
	if i == 0:
		a[i] = b[i]
	elif i == n-1:
		a[i] = b[i-1]
	else:
		a[i] = min(b[i], b[i-1])
print(sum(a))
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a <= k:
    print('Yay!')
else:
    print(':(')
# Judge status: Accepted
from collections import Counter
n=int(input())
a=Counter(list(map(int, input().split())))
ans=0
for i in a.keys():
  if i>a[i]:
    ans+=a[i]
  elif i<a[i]:
    ans+=a[i]-i
print(ans)
# Judge status: Wrong Answer
X, A, B = map(int, input().split())

print(min(abs(X-A), abs(B-X)))
# Judge status: Accepted

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

mx = 0

nn = n//b

mm = (a*n)//b - a*(nn)

if nn > 0:
    x = b*nn-1
    mx = (a*x)//b - a*(nn-1)
    mm = max(mm, mx)
    
print(mm)
# Judge status: Accepted
li = list(map(int, input().split()))
print("Yes" if sorted(li).index(li[2]) == 1 else "No")
# Judge status: Accepted
n=int(input())
l=[0 for i in range(n+1)]
l[0]=2
l[1]=1
for j in range(2,n+1):
  l[j]=l[j-1]+l[j-2]
print(l[n])
# Judge status: Accepted
# -*- coding: utf-8 -*-

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

if a>0:
    print("Positive")
elif a<=0 and b>=0:
    print("Zero")
else:
    if (a-b)%2==0:
        print("Negative")
    else:
        print("Positive")
# Judge status: Accepted
import math

A,B,H,M = map(int,input().split())

co_hour = [math.cos(((H*60 + M)/360 - 1/2) * math.pi) * A , math.sin(((H*60 + M)/360 - 1/2) * math.pi) * A]
co_min = [math.cos(((M/30 - 1/2) * math.pi)) * B, math.sin(((M/30 - 1/2) * math.pi)) * B]

x = co_hour[0] - co_min[0]
y = co_hour[1] - co_min[1]

Answer = math.sqrt(x * x + y * y)

print(Answer)
# Judge status: Wrong Answer
n,a,b=map(int, input().split())

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

ret = 0

ret = 2**n + 10**9+7 + 10**9+7
ret = ret - combination(n, a)
ret = ret - combination(n, b)
ret = ret % (10**9+7)
print(ret)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
t=a+b+c
k=0 if a+b==c or a+c==b or b+c==a else 0
print(['Yes','No'][k])
# Judge status: Accepted
S = sorted(input())
# print('S', S)
for i in range(len(S) - 1):
    if S[i] == S[i + 1]:
        print('no')
        exit()
print('yes')
# Judge status: Accepted
from functools import reduce

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y)
    
def lcm_base(x, y):
    return x*y//gcd(x, y)

def lcm_list(list):
    return reduce(lcm_base, list)

N, M = map(int, input().split())
a = list(map(int, input().split()))
b = [x//2 for x in a]
T = lcm_list(b)
for n in b:
    if T//n%2 == 0:
        print (0)
        break
else:
    print ((M//T+1)//2)
# Judge status: Wrong Answer
N = int(input())
MOD = 1e+9 + 7
a = [int(i) for i in input().split()]

b = [0 for _ in range(60)]

for i in a:
  for j in range(60):
    b[j] += (i >> j) & 1

ans = 0
for i, j in enumerate(b):
  ans += (j * (N - j)) * 2**i
  ans %= MOD
  
print(int(ans))
# Judge status: Accepted
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(M)]


city = [0]*N
for i in range(M):
    city[ab[i][0]-1] += 1
    city[ab[i][1]-1] += 1

for number in city:
    print(number)
# Judge status: Accepted
MOD = 10**9 + 7
max = 10**5 + 1
facts = [1 for i in range(max)]
invs = [1 for i in range(max)]

def inv(x):
    return pow(x,MOD-2,MOD)

for i in range(1,max):
    facts[i] = facts[i-1]*i%MOD
    invs[i] = inv(facts[i])

def comb(n,r):
    return facts[n]*invs[r] * invs[n-r] % MOD

n,m = map(int,input().split())
if m > n:
    n,m = m,n
if n-m >= 2:
    print(0)
elif n-m == 1:
    print(facts[m]*facts[n] % MOD)
else:
    print(facts[m]*facts[n]*2 % MOD)
# Judge status: Accepted
N, K = map(int, input().split())
l = list(map(int, input().split()))

for k in range(N - K):
    
    hel = l[k]
    huel = l[k + K]
    
    if (hel < huel):
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
import sys
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

x = int(input())
for i in range(x, 1000000):
    if is_prime(i) == True:
        print(i)
        break
# Judge status: Wrong Answer
n=int(input())
g=set()
for i in range(n):
    si=int(input())
    g2=set()
    for gg in g:
        g2.add(si+gg)
    g=g|g2
    g.add(si)
#    print(g2,g)

g3=list(g)
g3.sort(reverse=True)
for gg in g3:
    if gg%10==0:
        continue
    else:
        print(gg)
        break
    print(0)
# Judge status: Accepted
import sys
input = sys.stdin.readline
from collections import *

N = int(input())
S = input()[:-1]
cnt = Counter(list(S))
ans = 1
MOD = 10**9+7

for v in cnt.values():
    ans *= v+1
    ans %= MOD

print((ans-1)%MOD)
# Judge status: Accepted
X,N = map(int,input().split())

if N == 0:
	print(X)
	exit()

P = [int(i) for i in input().split()]
mn = 1000
for i in reversed(range(102)):
	if i in P:
		continue
	if mn >= abs(X-i):
		ans = i
		mn = min(mn,abs(X-i))

print(ans)
# Judge status: Accepted
import math
a,b,c = list(map(int, input().split()))
print("Yes" if 4*a*b < (c - a - b)*(c - a - b) and c - a - b > 0 else "No")
# Judge status: Accepted
import sys
from collections import deque

readline = sys.stdin.readline
readlines = sys.stdin.readlines

s = readline().rstrip()
q = readline()
queries = readlines()
s = deque(s)
tot_1 = 0
for i in queries:
    if i[0] == '1':
        tot_1 += 1
        continue
    c = i[4]
    if (tot_1 + int(i[2])) % 2 == 0:
        s.append(c)
    else:
        s.appendleft(c)
ans = "".join(s) if tot_1 % 2 == 0 else "".join(reversed(s))
print(ans)
# Judge status: Accepted
N,X=map(int,input().split())
L=[int(i) for i in input().split()]
count=1
dis=0
for t in L:
    dis=dis+t
    if dis<=X:
        count+=1
    else:
        break
print(count)
# Judge status: Wrong Answer
n, m = map(int, input().split())
print("AC" if n == m else "WA")
# Judge status: Accepted
from bisect import bisect
N = int(input())
A = [-int(input()) for i in range(N)]

mem = []
for a in A:
    i = bisect(mem, a)
    if i==len(mem):
        mem.append(a)
    else:
        mem[i] = a
print(len(mem))
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

X, K, D = mapint()
if X>=abs(K*D):
    print(abs(abs(X)-K*D))
else:
    l, r = 0, K
    X = abs(X)
    while r-l>1:
        half = (r+l)//2
        if half*D>X:
            r = half
        else:
            l = half
    now = X-l*D
    if (K-l)%2==0:
        print(now)
    else:
        print(D-now)
# Judge status: Accepted
x,n = map(int,input().split())
lst = sorted(list(map(int,input().split())))

ans = x
if ans in lst:
    pass
else:
    print(ans)
    exit()

left,right = ans-1,ans+1

while True:
    if left in lst and right in lst:
        left -=1
        right += 1

    elif left in lst:
        print(right)
        exit()

    else:
        print(left)
        exit()
# Judge status: Wrong Answer
N = int(input())
W = [input() for _ in range(N)]

set_W = set()

ans = "Yes"
for i in range(len(W) - 1):
    if W[i] in set_W:
        ans = "No"
        break

    set_W.add(W[i])

    if W[i][-1] != W[i + 1][0]:
        ans = "No"
        break

print(ans)
# Judge status: Accepted
K = int(input())
print(((K+1)//2)*(K//2))
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().strip().split()))

dp=[0 for n in range(max(a)+1)]
for n in range(N):
    dp[a[n]]+=1

ans=0
for n in range(len(dp)-1):
    if n==0:
        ans=max(ans,dp[0]+dp[1])
    elif n==N-1:
        ans=max(ans,dp[N-2]+dp[N-1])
    else:
        ans=max(ans,dp[n-1]+dp[n]+dp[n+1])

print(ans)
# Judge status: Accepted
a = list(map(str, input().split()))
b = len(a[0])
c = "x" * b
print(c)
# Judge status: Accepted
n = int(input())
s = [int(input()) for _ in range(n)]
all = sum(s)
if all % 10:
    print(all)
else:
    d = [i for i in s if i % 10]
    if d:
        all -= min(d)
        print(all)
    else:
        print(0)
# Judge status: Wrong Answer
x, y, z = map(int, input().split())
print(x*y/2)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split())) 

res = 0
for i in range(n):
    for j in range(n):
        if  i == j:
           pass
        elif (a[i] == a[j]) or (a[i]%a[j] == 0):
            break

    else:
        res += 1
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
K = int(input())

for i in range(K):
    for j in range(K):
        for k in range(K):
            if i+j+k != K:
                continue
            A = A*pow(2,i)
            B = B*pow(2,j)
            C = C*pow(2,k)
            if A < B and B < C:
                print("Yes")
                exit()
print("No")
# Judge status: Accepted
data = list(map(int, input().split()))
k = int(input())
if k == 1:
    print( sum(data) + max(data) )
else:
    tmp = max(data)
    for _ in range(k):
        tmp = tmp * 2
    print( sum(data) + tmp - max(data) )
# Judge status: Accepted
N = int(input())

n = 1
ans = 10**5

def calucurate(M):
    n = 0
    while M > 0:
        n += M%10
        M //= 10
    return n

while n < N:
    t = N - n
    m = calucurate(t) + calucurate(n)
    ans = min(ans,m)
    n += 1

print(ans)
# Judge status: Accepted
s = input()
if s[-1] == "s":
    s = s + "es"
else:
    s = s + "s"
print(s)
# Judge status: Accepted
a, b, c = map(int, input().split())
if a<=c and c<=b:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
x,y = map(int,input().split())
dum1 = [1,3,5,7,8,10,12]
dum2 = [4,6,9,11]
if x == 2:
    print("No")
else:
    if dum1.count(x) == 1 and dum1.count(y) == 1:
        print("Yes")
    elif dum2.count(x) == 1 and dum2.count(y) == 1:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
S=input()
X=set([s for s in 'abcdefghijklmnopqrstuvwxyz'])
for s in S:
  X.discard(s)
X=list(X)
X.sort()
X.append('None')
print(X[0])
# Judge status: Wrong Answer
from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

T = input()
t=list(T)
cnt=0
for i in range(len(t)):
    if t[i] == "?":
        if i != 0 and t[i-1] == "P":
            t[i] ="D"
        elif i != len(t)-1 and t[i+1] == "D":
            t[i] = "P"
        else:
            t[i] = "P"

for i in range(len(t)):
    print(t[i] ,end="")
print("")
# Judge status: Accepted
import numpy as np

R = int(input())
print(2*np.pi*R)
# Judge status: Accepted
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    enemy_hp = int(input())
    enemy_count=1
    attack_count=1

    if enemy_hp==1:
        print(1)
        exit()
    else:
        while enemy_hp >1:
            enemy_hp = int(enemy_hp/2)
            enemy_count*=2
            attack_count+=enemy_count
            
    print(attack_count)

if __name__=="__main__":
    main()
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())
diff_x = tx - sx
diff_y = ty - sy
ans = 'U' * diff_y + 'R' * diff_x + 'D' * diff_y + 'L' * diff_x
ans += 'LU' + 'U' * diff_y + 'R' * diff_x + 'RDRD' + 'D' * diff_y + 'L' * diff_x + 'LU'
print(ans)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e-a<=k: print("Yay!")
else: print(":(")
# Judge status: Accepted
s = input()
a = set(s)
if len(a) == 3:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N,M,X=map(int,input().split())
l=[]
for i in range (N):
  l.append(list(map(int,input().split())))
ans=10000000
for i in range(2**N):
  score=[0]*M
  coin=0
  for j in range(N):
    if i>=2**(N-1-j):
      for p in range(M):
        score[p]+=l[j][p+1]
      coin+=l[j][0]
      i-=2**(N-1-j)
  flag=0
  for q in range(M):
    if score[q]<X:
      flag=1
  if flag==0:
    if ans>coin:
      ans=coin
print(ans)
# Judge status: Accepted
A, B = map(float, input().split())
B = B * 100 + 0.99
B = int(B)
print(int(A) * B // 100)
# Judge status: Accepted
S = str(input())
N = len(S)

for i in range(N):
  for j in range(i,N):
        if S[:i] + S[j:] == 'keyence':
          print('YES')
          exit()

print('NO')
# Judge status: Accepted
a,b,c,k=map(int,input().split())
print(a-b if k%2==0 else b-a)
# Judge status: Accepted
S = input()

ls = len(S)

while True:
    ls -= 1
    if ls % 2 == 1:
        continue
    leftS = S[0:ls//2]
    rightS = S[ls//2:ls]
    if leftS == rightS:
        print(ls)
        exit()
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
mod = 998244353
if a[0] != 0:
  print(0)
  exit()
ans = 1
c = Counter(a)
cls = list(c.items())
cls.sort()
if cls[0][1] != 1:
  print(0)
  exit()
for i in range(1,len(cls)):
  if cls[i][0] != i:
    print(0)
    exit()
  ans = ans*cls[i-1][1]**cls[i][1]%mod
print(ans)
# Judge status: Wrong Answer
def LIS(A):
    dp = [-A[0]]
    for a in A[1:]:
        if -a >= dp[-1]:
            dp.append(-a)
        else:
            dp[bisect_left(dp, -a)] = -a
    return len(dp)

##################################################################################################################

import sys
input = sys.stdin.readline
from bisect import bisect_left

N = int(input())

A = [int(input()) for _ in range(N)]

print(LIS(A))
# Judge status: Accepted
def gcd(x,y):
    if x<y:
        x,y=y,x
    if y==0:
        return x
    return gcd(y,x%y)
def lcm(x,y):
    return x*y//gcd(x,y)

def main():
    x=int(input())
    l=lcm(360,x)
    print(l//x)
    
if __name__=='__main__':
    main()
# Judge status: Wrong Answer
from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
cnt = defaultdict(int)
data = []
for i in range(n):
    cnt[a[i]] += 1
if sum(v >= 2 for v in cnt.values()) < 2:
    print(0)
else:
    for k, v in cnt.items():
        if v >= 2:
            data.append(k)
    data.sort(reverse = True)
    print(data[0] * data[1])
# Judge status: Accepted
N = int(input())
S = list(input())
WL = 0
WR = 0
BL = 0
BR = 0

for i in range(N):
    if S[i] == '#':
        BR += 1
    else:
        WR += 1

ans = BL+WR

for i in range(N):
    if S[i] == '#':
        BR -= 1
        BL += 1
    else:
        WR -= 1
        WL += 1
    ans = min(ans,BL+WR)
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = list(reversed(input()))
t = list(input())


for idx, (ss, tt) in enumerate(zip(s,t)):
    if ss != tt:
        break
if list(reversed(s)) == t:
    print(len(s))
else:
    print(n + idx + 1)
# Judge status: Accepted
n,x = map(int,input().split())
a = sorted(list(map(int,input().split())))
ans = 0
for i,h in enumerate(a[:-1]):
    x-=h
    if x>=0:ans+=1
if x==a[-1]:ans+=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
print("Yes" if len(str(n)) == 4 and len(set(str(n))) < 3 else "No")
# Judge status: Accepted
from math import sqrt
print(int(sqrt(int(input())))**2)
# Judge status: Accepted
N = int(input())

t = [0]
x = [0]
y = [0]

for _ in range(N):
    a, b, c = list(map(int, input().split()))
    t.append(a)
    x.append(b)
    y.append(c)

# print(f"t:{t}\nx:{x}\ny:{y}")

for index in range(1, N + 1):
    distance = (x[index] - x[index - 1]) + (y[index] - y[index - 1])
    duration = t[index] - t[index - 1]
    if duration < distance or duration % 2 != distance % 2:
        print("No")
        break
else:
    print("Yes")
# Judge status: Accepted
a, b, n = map(int, input().split())

x = min(b - 1, n)

def f(x):
    return int(a * x / b) - a * int(x / b)

print(f(x))
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

ans = 0
a = tuple(a); b = tuple(b); c = tuple(c)
a = sorted(a)
b = sorted(b,reverse=True)
c = sorted(c)

import bisect
chk_b = [0]*n
for i,bi in enumerate(b):
  y = bisect.bisect_right(c, bi)
  chk_b[i] = max(0,n-y) + chk_b[i-1]
  
chk_b = tuple(chk_b)
b = sorted(b)
for i in a:
  x = bisect.bisect_right(b, i)
  ans += chk_b[n-1-x]
print(ans)
# Judge status: Accepted
# | Its_Rashid | #
v = [int(input()) for i in range(5)]
a = int(input())
for i in range(0 , 5) :
    for j in range(1 ,5) :
        if v[j] - v[i] > a:
            print(':(')
            quit()
else :
    print('Yay!')
# Judge status: Wrong Answer
s = input()
s = s.replace('dreamer', '')
s = s.replace('dream', '')
s = s.replace('eraser', '')
s = s.replace('erase', '')
if s == '':
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
n = int(input())
w = list(map(int, input().split()))

total = sum(w)
dif = 10**5
point = 0

for i in w:
    point += i
    if abs(total-2*i) < dif:
        dif = abs(total-2*point)
print(dif)
# Judge status: Accepted
pole1, pole2, pole3 = map(int, input().split())
if pole2 - pole1 == pole3 - pole2:
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
import collections
N,M = map(int, input().split())
A = list(map(int,input().split()))
D = collections.Counter(A)

A.sort()
max = 0 

for i in range(M):
    B,C = map(int, input().split())
    D[C] += B  

D = sorted(D.items(), key=lambda x:x[0],reverse=True)

sum = 0 
count = 0 
for k,v in D:
    print("k : " + str(k) + " v: " + str(v) + " n: " + str(N))
    if N > v : 
        sum += k * v
        N -= v 
    else : 
        sum += k * N 
        break 
print(sum)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

Flag = False
cnt = 0
S = 0
m = 10**9

for i in A:
  if i == 0:
    Flag = True
  elif i > 0:
    S += i
    m = min(m, i)
  else:
    S += -i
    cnt ^= 1
    m = min(m, -i)

if Flag or cnt == 0:
  print(S)
else:
  print(S-2*m)
# Judge status: Accepted
N, K = map(int, input().split())
A = [int(x) for x in input().split()]
numberlist = dict()
for i in range(N):
    if A[i] in numberlist:
        numberlist[A[i]] += 1
    else:
        numberlist[A[i]] = 1
numberlist = sorted(numberlist.items(), key=lambda x: x[1])
#print(numberlist)
ans = 0
index = 0
lenlist = len(numberlist)
while(1):
    if index >= lenlist - K:
        break
    ans += numberlist[index][1]
    index += 1
print(ans)
# Judge status: Accepted
import sys
import math
import collections
from collections import deque
from functools import reduce
import heapq
#x = int(input())
n, m = map(int, sys.stdin.readline().split())
#s = input()
h = list(map(int, sys.stdin.readline().split()))

l = []
for i in range(m):
    a, b = map(int, sys.stdin.readline().split())
    if h[a-1] > h[b-1]:
        l.append(b)
    elif h[b-1] > h[a-1]:
        l.append(a)
    else:
        l.append(a)
        l.append(b)


c = collections.Counter(l)
print(n-len(c))
# Judge status: Wrong Answer
n=int(input())
a=[0]
for _ in range(n):
    a.append(int(input()))
v=[1]
cnt=1
while len(v)==len(set(v)):
    v.append(a[v[-1]])
    cnt+=1
    if a[v[-1]]==2:
        print(cnt)
        exit()
print(-1)
# Judge status: Accepted
import sys
from math import gcd

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

X = int(readline())

g = gcd(X, 360)
print(360//g)
# Judge status: Accepted
from collections import deque
d = {key:deque(input()) for key in ['a','b','c']}

turn = 'a'
win = ''
while 1:
    if d[turn]:
        turn = d[turn].popleft()
    else:
        win = turn
        break

print(win.upper())
# Judge status: Accepted
import sys
from heapq import heapify, heappop, heappush
import bisect

N, M = map(int, input().split())
AB = sorted([list(map(int, sys.stdin.readline().split())) for _ in range(N)])
A = [x for x, y in AB]

hq = []
heapify(hq)

count = 0

for i in range(1, M + 1):
    c_1 = bisect.bisect_left(A, i)
    c_2 = bisect.bisect_right(A, i)
    if c_2 - c_1 != 0:
        for j in range(c_1, c_2):
            heappush(hq, -AB[j][1])
    
    if hq:
        count += -heappop(hq)
    
print(count)
# Judge status: Accepted
import math

a, b, x = map(float, input().split())
if a * a * b <= x * 2:
    h = 2 * (b - x / a / a)
    ret = math.degrees(math.atan2(h, a))
else:
    h = 2 * x / a / b
    ret = 90 - math.degrees(math.atan2(h, b))
print(ret)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A = [0] + A

from collections import Counter

L1 = [i+a for i, a in enumerate(A)][1:]
L2 = [i-a for i, a in enumerate(A)][1:]

C1 = Counter(L1)
C2 = Counter(L2)
C = Counter(L1+L2)

ans = 0
for k in C.keys():
    ans += C1[k]*C2[k]
print(ans)
# Judge status: Accepted
import numpy as np
W,H,N=map(int,input().split())
A=np.zeros((W,H))
B=[list(map(int,input().split())) for _ in range(N)]
for b in B:
    if b[2]==1:
        A[:b[0],:]=1
    elif b[2]==2:
        A[b[0]:,:]=1
    elif b[2]==3:
        A[:,:b[1]]=1
    elif b[2]==4:
        A[:,b[1]:]=1
print(np.count_nonzero(A==0))
# Judge status: Accepted
a = int(input())
if a == 7 or a == 5 or a == 3:
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
n,l = map(int,input().split())
list = []

for i in range(n):
    word = input()
    list.append(word)

list_connect = "".join(list)


print(list_connect)
# Judge status: Accepted
s = sorted(input())

if s[0] == s[1] and s[1] != s[2] and s[2] == s[3]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
t,x,y = 0,0,0
badtrip=False
for i in range(N):
    ti, xi, yi = list(map(int, input().split()))
    absx = abs(x-xi)
    absy = abs(y-yi) 
    if (absx+absy)%2 == (ti-t)%2 and (ti-t)>=(absx+absy):
        t=ti
        x=xi
        y=yi
    else:
        badtrip=True
        break

if badtrip:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
from collections import defaultdict
N = int(input())
raw_numbers = list(map(int, input().split()))
numbers = defaultdict(int)

for num in raw_numbers:
    numbers[num] += 1
    
total = sum(raw_numbers)
    
Q = int(input())

for _ in range(Q):
    a, b = list(map(int, input().split()))
    taken = numbers[a]
    total -= a * numbers[a]
    numbers[b] += numbers[a]
    total += b * taken
    print(total)
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = [inp() for _ in range(5)]
print((n+min(a)-1)//min(a) + 4)
# Judge status: Accepted
S = input()
N = len(S)+1
a = [0] * N
for i in range(N-1):
	if S[i] == '<':
		a[i+1] = a[i]+1
for i in range(N-2, -1, -1):
  if S[i] == '>':
    a[i] = max(a[i+1]+1,a[i])
 
print(sum(a))
# Judge status: Accepted
N = int(input())
print(sum((i*(N//i)*(N//i+1)//2) for i in range(1,N+1)))
# Judge status: Accepted
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353



n, k = list(map(int, sys.stdin.buffer.readline().split()))
if n % k == 0:
    print(0)
else:
    print(1)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if b-c == c-b:
  print('YES')
print('NO')