peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
A, B = map(int, input().split())

def prime_factorize(n):
    a = [1]
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

d=set(prime_factorize(A)) & set(prime_factorize(B))

print(len(d))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
cnt=3

if a==b:
    cnt-=1

if b==c:
    cnt-=1

if c==a:
    cnt-=1

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

if abs(a - b) >= 10e18:
    print("Unfair")
elif k//2 == 0:
    print(a - b)
else:
    print(b - a)
# Judge status: Accepted
import math
x,k,d=map(int,input().split(" "))


if x<0:
  x=(-1)*x
if d<0:
  d=(-1)*d
  
s=math.floor(x/d)

if k<s:
  print(x-d*k)
else:
  w=k-s
  v=x-d*s
  if w%2==0:
    print(v)
  else:
    print(abs(v-d))
# Judge status: Accepted
A, B, C = sorted(map(int, input().split()))
print(C * 10 + A + B)
# Judge status: Wrong Answer
def judge(n):
    if n % 2 == 0:
        return n / 2
    else:
        return 3*n + 1

s = int(input())
ans = 1

while s != 4:
    s = judge(s)
    ans += 1

print(ans+3)
# Judge status: Accepted
n = int(input())
s = []
for i in range(n):
  s.append(int(input()))
s.sort()
ans = 0
for i in range(n):
  if sum(s)%10 != 0:
    ans = sum(s)
    break
  else:
    for i in range(n):
      if s[i]%10 != 0:
        s.remove(s[i])
        ans = sum(s)
        break
print(ans)
# Judge status: Accepted
T = str(input())

T = T.replace('P?','PD')
T = T.replace('?','D')

print(T)
# Judge status: Accepted
line = input()
A,B = [int(n) for n in line.split()]

if(abs(A-B) >= 2):
    res = max(A,B)+(max(A,B)-1)
else:
    res = A+B
print(res)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
counts=[0]*60
for b in a:
    for i in range(60):
        counts[i]+=b%2
        b//=2
ans=0
mod = 10**9+7
for i in range(60):
    c=counts[i]
    comb=c*(n-c)
    ans=(ans+(1<<i)*comb)%mod
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ans = 0
mod = pow(10,9)+7

B = []
x = 0
for i in range(N-1):
    x += A[i]
    x %= mod
    B.append(x)

ans = 0
for i in range(1,N):
    ans += A[i]*B[i-1]
    ans %= mod

print(ans)
# Judge status: Accepted
N = int(input())

t = [0] * N
x = [0] * N
y = [0] * N

for i in range(N):
    t[i], x[i], y[i] = map(int, input().split())

judg = 0    

for i in range(N):
    if x[i]+y[i]<=t[i]:
        if t[i]%2==0 and (x[i]+y[i])%2==0:
            judg += 1
        elif t[i]%2!=0 and (x[i]+y[i])%2!=0:
            judg += 1

if judg == N:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

A, B, C, D = map(int, input().split())
cnt = B - A + 1
all_range = B // C + B // D - B // lcm(C , D)
sub_end = A - 1
sub_range = sub_end // C + sub_end // D - sub_end // lcm(C , D)
print(cnt - (all_range - sub_range))
# Judge status: Accepted
a, b, k = map(int, input().split())

min = [0] * k
max = [0] * k

for i in range(k):
  if a+i > b:
    break
  min[i] = a+i

for n in range(k):
  if b-n < a:
    break
  max[n] = b-n

ans = min + max
ans = set(ans)
ans = list(ans)
ans.sort()

for j in ans:
  if j == 0:
    continue
  print(j)
# Judge status: Accepted
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

n = int(input())

ans = 10 ** 15
div_list = make_divisors(n)
for temp in div_list:
    temp2 = n//temp
    ans = min( temp + temp2 - 2 ,ans    )
print(ans)
# Judge status: Accepted
S = input()
ans = 0
for i in range(3):
    if S[i]=='1':
        ans += 1

print(ans)
# Judge status: Accepted
n=int(input())
b=[int(x) for x in input().split()]

ans=b[0]

if len(b)==1:
    print(b[0]*2)
else:
    for i in range(1,n-1):
        ans+=min(b[i],b[i-1])
    print(ans+b[-1])
# Judge status: Accepted
A = list(map(int, input().split()))
A = sorted(A)
if any([a % 2 == 0 for a in A]):
    print(0)
else:
    print(A[0] * A[1])
# Judge status: Wrong Answer
import math
x, y = map(int, input().split())
ans = 0

#ans = int(math.log2(y/x))

while y > x:
    x = x * 2
    ans += 1

print(ans + 1)
# Judge status: Accepted
K = int(input())

N = 1000000
x = 7 % K

for i in range(1, N+1):
    if x == 0:
        break
    x = (x * 10 + 7) % K

if i == N:
    i = -1

print(i)
# Judge status: Accepted
#!/usr/bin/env python3

s = input()

if s == 'ABC':
    print("ARC")
elif s == 'ARC':
    print("ABC")
else:
    print("not expection word input")
# Judge status: Accepted
CAKE = 4
DONUTS = 7
n = int(input())
max_cake = n//CAKE
max_donuts = n//DONUTS
flag = 0
for i in range(max_cake+1):
    for j in range(max_donuts+1):
        if i*CAKE+j*DONUTS == n:
            flag = 1
if flag == 1 :
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s=list(input())
t=list(input())

s.sort()
t.sort(reverse=True)

''.join(s)
''.join(t)

if s < t:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
s = input()
x = 0
i = 0
for i in range(len(s)):
  i = i + (s[i]=='I') - (s[i]=='D')
  x = max(x,i)
print(x)
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))

ans = 0
mod = 1e9 + 7

for i in range(n):
    ans += A[i] * sum(A[i+1:])

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

v.sort()
value = 0
for i, x in enumerate(v):
    if i < 2:
        value += x
    else:
        value += x * (2 ** (i - 1))
print(value / 2 ** (len(v) - 1))
# Judge status: Wrong Answer
n=input()
a=0
b=[0,1,2,3,4,5,5,4,3,2]
for i in range(len(n)):
    a+=b[int(n[i])]
    if i+1!=len(n):
        if int(n[i])>5:
            a-=1
print(a)
# Judge status: Wrong Answer
N = int(input()) 
num = N // 11
res = 0
k = 0
res = num * 2
k = res * 11
if N % 11 == 0:
  pass
else:
  res +=  1
  k += 5
  if k < N:
    res +=  1
    k += 6
print(res)
# Judge status: Accepted
n,l = map(int,input().split())
input_lines = [input() for i in range(n)]

print(''.join(sorted(input_lines)))
# Judge status: Accepted
import math 
n = int(input())
a = [int(i) for i in input().split()]


    
ans = a[0]

for i in range(n-1):
    ans = math.gcd(ans, a[i+1])
    
    
print(ans)
# Judge status: Accepted
N, H = map(int, input().split())
slash = 0
Throw = []
for _ in range(N):
    a, b = map(int, input().split())
    slash = max(slash, a)
    if b > a: Throw.append(b)    
#slash=斬撃最大ダメージ、投げてslash超のダメージが出るならばその刀をダメージが大きい順に投げる
Throw = sorted([th for th in Throw if th > slash], reverse=True)
dmg, cnt = 0, 0
for throw in Throw:
    if dmg >= H: break
    dmg += throw
    cnt += 1
if dmg < H:
    from math import ceil
    cnt += ceil((H-dmg)/slash)
print(cnt)
# Judge status: Accepted
x = int(input())
y = x % 11
if y > 0:
    cnt = 1
    if y > 6:
        cnt += 1
else:
    cnt = 0
    
print((x // 11) * 2 + cnt)
# Judge status: Accepted
x = int(input())

ans = 0
tmp = 1
for i in range(1, int(x**0.5)+1):
    for j in range(2, x):
      tmp = pow(i, j)
      if tmp > x:
          tmp = pow(i, j-1)
          #print(tmp, i, j)
          break

    ans = max(tmp, ans)

print(ans)
# Judge status: Accepted
c = input()
A = ['a', 'e', 'i', 'o', 'u']
if c in A:
    print('vowel')
else:
    print('consonant')
# Judge status: Wrong Answer
import numpy as np
from itertools import product

def readlines(n):
    for _ in range(n):
        yield list(map(int, input().split()))

def main():
    N, M, X = map(int, input().split())

    books = np.array(list(readlines(N)))
    ans = np.inf
    for bit in product([0, 1], repeat=N):
        comb_sum = np.dot(np.array(bit), books)
        if all(comb_sum[1:] >= X):
            ans = min(ans, comb_sum[0])

    print(ans)
        


main()
# Judge status: Accepted
print('ABD') if int(input()) >= 1000 else print('ABC')
# Judge status: Accepted
def main():
    n = int(input())
    k = int(input())
    x = int(input())
    y = int(input())
    cost = 0
    
    if n <= k:
        cost += n * x
    elif n > k:
        cost += k * x + (n - k) * y
    print(cost)
    
  
if __name__ == '__main__':
  main()
# Judge status: Accepted
N = int(input())
ans = ((N-1)*N)//2
print(ans)
# Judge status: Accepted
a,b = input().split()
a += b
can = 0
for i in range(1,1000):
  if(i*i == int(a)):
    can = 1
if(can == 1):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

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

x = list(map(int, input().split()))
x.sort()

if len(x) == 1:
    print(int(*x)-X)
else:
    res = [abs(x[i+1]-x[i]) for i in range(len(x)-1)]
    print(gcd(*res))
# Judge status: Accepted
a, b = map(int, input().split())
prod = a * b
if prod % 2 == 0:
  print('Even')
else:
  print('Odd')
# Judge status: Accepted
A = []
for _ in range(3):
    A.append(list(map(int, input().split())))

B = set()
for _ in range(int(input())):
    B.add(int(input()))


checkList = list()
for i in range(3):
    checkList.append(set(A[i]))
for j in range(3):
    checkList.append(set([A[0][j], A[1][j], A[2][j]]))
checkList.append(set([A[0][0], A[1][1], A[2][2]]))
checkList.append(set([A[0][2], A[1][1], A[2][0]]))

flag = False
for s in checkList:
    if len(s - B) == 0:
        flag = True
        break

if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
A,B,C,K=map(int,input().split())
ans=A-B
if ans>10**18:
	print('Unfair')
if K%2==0:
	print(ans)
else:
	print(-ans)
# Judge status: Accepted
n=int(input())
ans=''
check='abcdefghijklmnopqrstuvwxyz'
while n!=0:
  n-=1
  ans+=check[n%26]
  n//=26
print(ans[::-1])
# Judge status: Wrong Answer
import collections

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

ct = collections.Counter(A)

ret = []
total = 0
for k,count in ct.items():
    if count > 1:
        total += count * (count-1) // 2

for i,v in enumerate(A):
    if ct[v] > 1:
        count = ct[v]
        adjust = (count-1) * (count-2) // 2 - (count-1) * count // 2
        val = total + adjust
    else:
        val = 0
    print(val)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = [0] * n

for i in range(n - 1):
    b[a[i] - 1] += 1

for subordinate in b:
    print(subordinate)
# Judge status: Accepted
a,b,c,d=map(int, input().split())
maximum_list=(a*c,a*d,b*c,b*d)
print(max(maximum_list))
# Judge status: Accepted
A,B=map(int,input().split())
C=1
if B==1:
    Ans=0
else:
    for i in range(20):
        D=C+(A-1)*(i+1)
        if D>=B:
            Ans=i+1
            break
        else:
            pass

print(Ans)
# Judge status: Wrong Answer
l, r = map(int, input().split())

lsmod = []
for i in range(l, min(l + 2019, r + 1)):
	lsmod.append(i % 2019)

lsmod.sort()
print((lsmod[0] * lsmod[1]) % 2019)
# Judge status: Accepted
N = int(input())
rank = 0
if N >= 400 and 599 >= N:
    rank = 8
elif N >= 600 and 799 >= N:
    rank = 7
elif N >= 800 and 999 >= N:
    rank = 6
elif N >= 1000 and 1199 >= N:
    rank = 5
elif N >= 1200 and 1399 >= N:
    rank = 4
elif N >= 1400 and 1599 >= N:
    rank = 3
elif N >= 1600 and 1799 >= N:
    rank = 2
elif N>= 1800 and 1999 >= N:
    rank = 1
print(rank)
# Judge status: Accepted
s = int(input())

mod = 10**9 +7

dp = [0]*(s+1)
dp[0] = 1
for i in range(1,s+1):
  for j in range(0,(i-3)+1):
    dp[i] += dp[j]
    dp[i] %= mod
print(dp[s])
# Judge status: Wrong Answer
W,H,N = [int(i) for i in input().split()]
A = [list(map(int, input().split())) for i in range(N)]

x1,y1 = 0,0
x2 = W
y2 = H

for i in range(N):
    if A[i][2] == 1:
        x1 = A[i][0]
    elif A[i][2] == 2:
        x2 = A[i][0]
    elif A[i][2] == 3:
        y1 = A[i][1]
    elif A[i][2] == 4:
        y2 = A[i][1]

print((x2-x1)*(y2-y1))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.insert(0,"X")
B.insert(0,"X")
C.insert(0,"X")
stf_c = 0
j = 100
for i in range(1,N+1):
	if A[i] == j+1:
		stf_c += (B[A[i]]+C[j])
		j = A[i]
	else:
		stf_c += B[A[i]]
		j = A[i]
print(stf_c)
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.append(n)
d=[]
for i in range(len(a)-1):
    d.append([i,a[i+1]-a[i]])
l=sorted(d,key=lambda x:x[1])

o=l[-1][0]
g=a[o]+n-a[o+1]
print(g)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

import itertools
import bisect

n = int(readline())
a = tuple(map(int, readline().split()))
cumsum = tuple(itertools.accumulate(a))
index = bisect.bisect(cumsum, sum(a) // 2)
ans = min(cumsum[n - 1] - cumsum[index - 1] * 2, cumsum[index] * 2 - cumsum[n - 1])
print(ans)
# Judge status: Accepted
s = input()
ca,cb,cc = 0,0,0
for i in range(len(s)):
    if s[i] == "a":
        ca += 1
    elif s[i] == "b":
        cb += 1
    else:
        cc += 1
mx = max(max(ca,cb),cc)
mn = min(min(ca,cb),cc)
if mx - mn >= 2:
    print("NO")
else:
    print("YES")
# Judge status: Accepted
# B - AcCepted

S = list(str(input()))
ans = 'AC'
if S[0] != 'A':
    ans = 'WA'
else:
    S[0] = 'a'

cnt = 0
for i in range(2, len(S)-1):
    if S[i] == 'C':
        cnt += 1
        S[i] = 'c'
if cnt != 1:
    ans = 'WA'

for s in S:
    if s.islower() == False:
        ans = 'WA'
        break

print(ans)
# Judge status: Accepted
import numpy as np
R = int(input())
print(2*R*np.pi)
# Judge status: Wrong Answer
from math import atan,pi
a,b,x=map(int,input().split())
#台形
h=x/(a**2)
c=(b-h)*2
theta=atan(c/a)/2/pi*360
print(theta)
# Judge status: Wrong Answer
import re
a, b = map(int, input().split())
s = input()

if s[a] == "-":
    if len(s[0:a]) == a and len(s[a+1::]) == b:
        if s[0:a] in r'[^0-9]' or s[a+1::] in r'[^0-9]':
            print("No")
        else:
            print("Yes")
else:
    print("No")
# Judge status: Accepted
N, M = map(int, input().split())
s = [0]*N
t = [1]*N
s[0] = 1
res = 1
for _ in range(M):
    x, y = map(int, input().split())
    x-=1
    y-=1
    t[x] -= 1
    t[y] += 1
    if s[x] == 1:
        if t[x]==0:
            s[x] = 0
            if s[y]==1:
                res -= 1
        else:
            if s[y]!=1:
                res += 1
        s[y] = 1
print(res)
# Judge status: Wrong Answer
n = int(input())
s = input()
li_s = list(s)

import collections
c = collections.Counter(li_s)
cci = c.items()
tmp = 1
for cc in cci:
    #print(cc[1])
    tmp *= (cc[1]+1)
if tmp >1:
    print(tmp-1)
else:
    print(tmp)
# Judge status: Accepted
from fractions import gcd
from functools import reduce

n, m = map(int, input().split())
a = [int(i) for i in input().split()]
c = 1
while a[0] % 2 == 0:
    a[0] //= 2
    c *= 2
a[0] *= c
for ai in a[1:]:
    if ai % c or (ai // c) % 2 == 0:
        print(0)
        break
else:
    lcm = reduce(lambda x, y: x * y // gcd(x, y), a) // 2
    print(m // lcm - m // (2 * lcm))
# Judge status: Wrong Answer
# Vicfred
# https://atcoder.jp/contests/abc132/tasks/abc132_b
# implementation
n = int(input())
p = list(map(int,input().split()))

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

print(answer)
# Judge status: Accepted
N = int(input())
S = "abcdefghijklmn"
Q = [(1,1,"a")]
A = []
while Q:
    q = Q.pop(-1)
    if q[0]==N:
        A.append(q[2])
        continue
    for i in range(q[1]+1):
        Q.append((q[0]+1,max(q[1],i+1),q[2]+S[i]))
for a in sorted(A):print(a)
# Judge status: Wrong Answer
N, M = map(int, input().split())

isACs = [0] * N
numPenalty = 0
for _ in range(M):
    p, res = input().split()
    p = int(p) - 1
    if res == 'AC':
        isACs[p] = 1
    else:
        if not isACs[p]:
            numPenalty += 1

numAC = sum(isACs)
print(numAC, numPenalty)
# Judge status: Accepted
N = int(input())
arr = []

for _ in range(N):
    arr.append(input())

print(f'AC x {arr.count("AC")}')
print(f'WA x {arr.count("WA")}')
print(f'TLE x {arr.count("TLE")}')
print(f'RE x {arr.count("RE")}')
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

L_list = {}
R_list = {}
cnt = 0
for i in range(N):
    L = i+1 + A[i]
    R = i+1 - A[i]

    if L in R_list.keys():
        cnt += R_list[L]
    if R in L_list.keys():
        cnt += L_list[R]

    if L in L_list.keys():
        L_list[L] += 1
    else:
        L_list[L] = 1
    if R in R_list.keys():
        R_list[R] += 1
    else:
        R_list[R] = 1

print(cnt)
# Judge status: Accepted
n,m=list(map(int,input().split()))
road_input=[]
for i in range(m):
    road_input.append(list(map(int,input().split())))

#隣接リスト
road=[[] for i in range(n+1)]
for i in range(m):
    road[road_input[i][0]].append(road_input[i][1])
    road[road_input[i][1]].append(road_input[i][0])

from collections import deque
q=deque([1])
ans=[-1 for i in range(n)]
while len(q)>0:
  p=q.popleft()
  for i in road[p]:
    if ans[i-1]== -1:
      ans[i-1]=p
      q.append(i)

print("Yes")
for j in range(1,n):
    print(ans[j])
# Judge status: Wrong Answer
N = input()
ret = 0
for c in N:
  ret += ret + int(c) % 9
  
if ret % 9 == 0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, l = map(int, input().split())
s = []
for i in range(n):
    s.append(input())
s.sort()
ans = ""
for i in s:
    ans += i
print(ans)
# Judge status: Wrong Answer
#n=int(input())
#l=list(map(int,input().split()))
n=3
l=[1, 4, 1]

c_4=0
even=0
odd=0

for i in l:
  if i%4==0:
    c_4+=1
  elif i%2==0:
    even+=1
  else:
    odd+=1
  
if even==0 and odd-1 <= c_4:
  ans="Yes"
else:
  ans="No"
  
if even>0 and odd <= c_4:
  ans="Yes"

print(ans)
# Judge status: Wrong Answer
hp, atk = input().split()

hp = int(hp)
atk = int(atk)

numlist = list((input().split()))

numlist = list(map(int, numlist))

numlist = sorted(numlist, reverse=True)

print(numlist)

for i in range(atk):
    value = 0
    value = value + numlist[i]
    if value > hp:
        print("Yes")
        break
    else:
        print("No")
        break
# Judge status: Accepted
H = int(input())
W = int(input())
N = int(input())

i = 0
j = 0
if H > W:
    while i < N:
        j = j + 1
        i = H + i
elif H < W:
    while i < N:
        j = j + 1
        i = W + i
else:
    while i < N:
        j = j + 1
        i = H + i
print(j)
# Judge status: Accepted
s = int(input())

ans = [s]

while True:
    if s % 2 == 0:
        s //= 2
    else:
        s = 3 * s + 1
    if ans.count(s) != 0:
        ans.append(s)
        break
    else:
        ans.append(s)


print(len(ans))
# Judge status: Wrong Answer
x = int(input())
y = 360 / x
print(int(y))
# Judge status: Accepted
def vacation(costs):
    total = [0, 0, 0]
    next_total = [0, 0, 0]

    i, j, k = 0, 1, 2
    for c in costs:
        for _ in range(3):
            next_total[i] = c[i] + max(total[j], total[k])
            i, j, k = j, k, i
        total, next_total = next_total, total
    return max(total)


def main():
    n = int(input())

    costs = [None] * n
    for idx in range(n):
        costs[idx] = [int(x) for x in input().split()]

    return vacation(costs)

print(main())
# Judge status: Accepted
s = input()
k = int(input())

limit = min(100, k)

ans = 1
for i in range(limit):
    if s[i] != '1':
        ans = s[i]
        break

print(ans)
# Judge status: Accepted
from collections import deque
sa=deque(list(input()))
sb=deque(list(input()))
sc=deque(list(input()))
s=sa.popleft()
while True:
  if s=='a':
    if len(sa)>0:
      s=sa.popleft()
    else:
      print('A')
      exit()
  elif s=='b':
    if len(sb)>0:
      s=sb.popleft()
    else:
      print('B')
      exit()
  elif s=='c':
    if len(sc)>0:
      s=sc.popleft()
    else:
      print('C')
      exit()
# Judge status: Wrong Answer
from itertools import combinations_with_replacement
N, M, Q = [int(n) for n in input().split()]
X = [[int(n) for n in input().split()] for _ in range(Q)]
ans = []
for A in combinations_with_replacement(range(1, M+1), N):
    t = 0
    for x in X:
        if A[x[1]-1]-A[x[0]-1] == x[2]:
            t += x[3]
    print(A, t)
    ans.append(t)
print(max(ans))
# Judge status: Accepted
import math

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

V = (a**2)*b

if x < V/2:
    t = (2*x)/(a*b**2)
    print(90 - math.degrees(math.atan(t)))
else:
    t = (2*b/a) - (2*x/a**3)
    print(math.degrees(math.atan(t)))
# Judge status: Wrong Answer
n = int(input())
l = list(map(int,input().split(" ")))

print(sum(l))
m=max(l)
if m - (sum(l)-m):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n, m = map(int, input().split())
L = dict(map(int, input().split()) for _ in range(n))
ans = 0
L = sorted(L.items())
for i in L:
    if i[1] >= m:
        ans += i[0] * m
        break
    else:
        m -= i[1]
        ans += i[0] * i[1]
print(ans)
# Judge status: Accepted
n=int(input())
if n - 999 > 0:
  print('ABD')
else:
  print('ABC')
# Judge status: Accepted
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
p = LI()
tmp = inf
ans = 0
for i in range(n):
    if tmp > p[i]:
        ans += 1
        tmp = p[i]
print(ans)
# Judge status: Wrong Answer
N, C, K = map(int, input().split())
T = sorted([int(input()) for _ in range(N)])

first = 0
bus = 1
nowpassenger = 0
for i in range(N):
    watingtime = T[i] - T[first]
    if watingtime > K:
        bus += 1
        first = i
        nowpassenger = 0
    elif nowpassenger >= C:
        bus += 1
        first = i
        nowpassenger = 0
    else:
        nowpassenger += 1

print(bus)
# Judge status: Wrong Answer
#https://atcoder.jp/contests/abc172/tasks/abc172_b

'''
<考え>
sとtを一文字ずつ比較し、異なる文字の数を出力
(s,tの長さが等しいと条件にある)
'''


#入力
s = str(input())
t = str(input())

#変数
count = 0

#必要な値を計算
l = len(s)

#処理
for i in range(l):
    print(s[i], t[i])
    if (s[i] != t[i]):
        count += 1

#出力
print(count)
# 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)
else :
    print(1)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
ans=1
temp=0
for i in range(1,n):
  if a[i-1]<a[i] and temp==0:
    temp=1
  elif a[i-1]>a[i] and temp==0:
    temp=2
  elif a[i-1]>a[i] and temp==1:
    temp=0
    ans=ans+1
  elif a[i-1]<a[i] and temp==2:
    temp=0
    ans=ans+1
print(ans)
# Judge status: Accepted
def main():
    n, k = map(int, input().split())
    sum_min = 0
    sum_max = 0
    ans = 0
    m = 10**9 + 7
    for i in range(k-1):
        sum_min += i
        sum_max += n-i
    for i in range(k-1, n+1):
        sum_min += i
        sum_max += n-i
        ans += sum_max - sum_min + 1
        ans %= m
    print(ans)
    

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
i=input().split()
a=i[0]
b=i[1]
c=i[2]
if(a==b and b==c):
 print("YES")
else:
 print("NO")
# Judge status: Accepted
from math import sqrt
N=int(input())

for i in range(int(sqrt(N)),0,-1):
  j = N/i
  if j == int(j):
    print(int(i+j-2))
    break
# Judge status: Wrong Answer
n = int(input())
H = [0]+list(map(int,input().split()))

if n >= 3:
    dp = [0]*(n+1)
    dp[2] = abs(H[2]-H[1])
    dp[3] = min(abs(H[3]-H[2]), abs(H[3]-H[1]))
    for i in range(4,n+1):
        dp[i] = min(abs(H[i]-H[i-1])+dp[i-1], abs(H[i]-H[i-2])+dp[i-2])
        
    print(dp[n])
else:
    print(abs(H[2]-H[1]))