peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
print(800*n-(n//15*200))
# Judge status: Accepted
N, K = map(int, input().split())
dice = list(map(int, input().split()))
ma = 0
kitai = [0]*N
for i in range(N):
    kitai[i] = (((dice[i]+1)*dice[i])/2)/dice[i]
for i in range(K):
    ma += kitai[i]
tmp = ma
for i in range(K,N):
    tmp = tmp - kitai[i-K] + kitai[i]
    ma = max(tmp,ma)
print(ma)
# Judge status: Accepted
N,M=map(int,input().split())
AB=[]
for _ in range(N):
    a,b=map(int,input().split())
    AB.append([a,b])
AB.sort(key=lambda x:x[0])
import heapq
h=[]
day=1
count=0
ans=0
while True:
    if day>M:
        break
    while count!=N:
        if AB[count][0]!=day:
            break
        heapq.heappush(h,-AB[count][1])
        count+=1
    if len(h)!=0:
        ans-=heapq.heappop(h)
    day+=1
print(ans)
# Judge status: Wrong Answer
import math

r=float(input())

L=2*math.pi*r

print('L={0}'.format(L))
# Judge status: Accepted
a, b, c = map(int, input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
x, y = map(int, input().split())

for c in range(x+1):
    t = x - c
    if 2*c + 4*t == y:
        print('Yes')
        exit()

print('No')
# Judge status: Wrong Answer
import re
pattern = re.compile('[ACGT]+')
S = input()
print(len(max(re.findall(pattern, S), default='')))
# Judge status: Accepted
n,m = map(int,input().split())
mod = 10**9 + 7
import math
def perm(n, r):
    return (math.factorial(n) // math.factorial(n - r))%mod

if abs(n-m) >= 2:
    print(0)
else:
    mx = max(n,m)
    mn = min(n,m)
    p = math.factorial(mn)%mod
    k = (mn-1)*math.factorial(mx)%mod if mn == mx else 0
    print(p*(perm(mn+1,mx) - k)%mod)
# Judge status: Wrong Answer
L,M,N = map(int,input().split())
print("win" if L+M+N >= 22 else "bust")
# Judge status: Accepted
p , q ,r = map(int,input().split())
print(p+q+r-max(p,q,r))
# Judge status: Accepted
N=input()

if "7" in N:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,m = map(int,input().split())

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

for i in range(m):
  a[n-1] = int(a[n-1]//2)
  a.sort()

res = 0
for i in range(n):
  res += i
  
print(res)
# Judge status: Accepted
A,B=map(int,input().split())
ans=0
for i in range(A,B+1):
  check1=str(i)
  check2=check1[::-1]
  if check1==check2:
    ans+=1
print(ans)
# Judge status: Accepted
n = int(input())
print(sum((n // i + 1) * (n // i) // 2 * i for i in range(1, n + 1)))
# Judge status: Accepted
t = input()
n = len(t)
ans = []
for i in range(n):
    if t[i] != "?":
        ans.append(t[i])
    else:
        ans.append("D")
print("".join(ans))
# Judge status: Accepted
N, D = map(int, input().split())

r = (2 * D + 1)

if N % r == 0:
  print(N // r)
else:
  print(N // r + 1)
# Judge status: Accepted
s = input()
n = 753
ans = float('inf')
for i in range(len(s)-2):
    x = int(s[i:i+3])
    if abs(x-n) < ans:
        ans = abs(x-n)
print(ans)
# Judge status: Accepted
from math import *
N = int(input())

print(ceil(N/2))
# Judge status: Wrong Answer
s = input()
for i in range (len(s)//2):
    if s[2*i] == 'L' or s[2*i+1] == 'R' or s[-1] == 'L':
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
import sys
input=sys.stdin.buffer.readline
n=int(input())
L=list(int(input()) for i in range(n))
N=sorted(L)
for i in range(n):
    print(N[-1] if L[i]!=N[-1] else N[-2])
# Judge status: Accepted
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

k = 1
p = False
for i in range(n):
    if a[k-1] == 2:
        print(i+1)
        p = True
        break
    k = a[k-1]
if not p:
    print(-1)
# Judge status: Accepted
a, b, c = map(int, input().split())
print('Yes' if a + b >= c else 'No')
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
A, B = map(int, input().split())

n = max(A, B) ** 0.5
n = int(n) + 2
is_primes = [True for _ in range(n)]
for i in range(2, n):
    if is_primes[i]:
        for j in range(i*2, n, i):
            is_primes[j] = False

# print(is_primes)

ans = [1]
for i in range(2, n):
    if is_primes[i]:
        if A % i == 0 and B % i == 0:
            ans.append(i)

# print(ans)
print(len(ans))
# Judge status: Accepted
a = int(input())
if a % 9 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
A = sorted(map(int, input().split()))

x = 0

while A[0] < A[2] - 1:
    A[0] += 2
    x += 1

while A[1] < A[2] - 1:
    A[1] += 2
    x += 1

if A[0] == A[1]:
    x = x + 1
else:
    x = x + 1

print(x)
# Judge status: Wrong Answer
X,K=map(int,input().split())
if 500*X>K :
    print('Yes')
else :
    print('No')
# Judge status: Accepted
n = int(input())
n = n*800 - (n//15)*200
print(n)
# Judge status: Accepted
n = int(input())
s = input()
e_l, e_sum = [], 0
w_l, w_sum = [], 0
for i in range(n):
    if s[i] == 'E':
        e_sum += 1
    else:
        w_sum += 1
    e_l.append(e_sum)
    w_l.append(w_sum)
for i in range(n):
    if i == 0:
        ans = e_l[n-1] - e_l[0]
    elif i == n:
        ans = max(ans, w_l[n-2])
    else:
        ans = min(ans, e_l[n-1] - e_l[i] + w_l[i-1])
print(ans)
# Judge status: Accepted
import sys
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print("Yes")
  sys.exit()
if abs(a-b)<=d and abs(b-c)<=d:
  print("Yes")
  sys.exit()
print("No")
# Judge status: Accepted
n = "0" + input()

ans = 0
n_dig = len(n) # Nの桁数

carry = 0
d_next = int(n[n_dig - 1])

for i in range(n_dig - 1, 0, -1):  # n[0]はダミーなのでn[1]で止める
    d = d_next
    d_next = int(n[i - 1])

    if carry + d <= 4 or (carry + d == 5 and d_next <= 4):
        ans += d + carry
        carry = 0  # 繰り上がり
    else:
        ans += 10 - d - carry
        carry = 1

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

Odd=0

for i in range(1,N+1):
  if i%2==1:
    Odd+=1
    
print(Odd/N)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
a.sort()
for i in range(n):
    a.pop()
ans=0
for i in range(1,n+1):
    ans+=a[-i]
print(ans)
# Judge status: Accepted
A, B, K = map(int,input().split())
if A + B <= K:
    a = 0
    b = 0
else:
    if K == 0:
        a = A
        b = B
    elif K > A:
        a = 0
        b = abs(B-(K-A))
    elif K == A:
        a = 0
        b = B
    elif K < A:
        a = A - K
        b = B
print(a,b)
# Judge status: Accepted
# solution

import fractions

data=int(input())
array=list(map(int,input().split()))
array1=[]
for i in range(1,data):
    array1.append(fractions.gcd(array[0],array[i]))
print(min(array1))
# Judge status: Accepted
n, a, b, c, d = map(int, input().split())
s = input()

if c < d:
    if s[a-1:c].find('##')==-1 and s[b-1:d].find('##')==-1:
        print('Yes')
    else:
        print('No')
else:
    if s[a-1:c].find('##')==-1 and s[b-1:d].find('##')==-1 and s[b-2:d+1].find('...')!=-1:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
import sys
import numpy as np

read = sys.stdin.read

n, m = map(int, input().split())
h = list(map(int, input().split()))
way = np.array(read().split(), dtype=np.int64).reshape([m,2]) - 1

o = np.ones(n)
for i in way:
    a, b = i
    if h[a] <= h[b]:
        o[a] = 0
    if h[b] <= h[a]:
        o[b] = 0
ans = np.count_nonzero(o)
print(ans)
# Judge status: Accepted
s=input()

if s<="2019/04/30":
    print("Heisei")
else:
    print("TBD")
# Judge status: Wrong Answer
import statistics
a=list(map(int,input().split()))
print(round(statistics.mean(a)))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
Asum = sum(A) % (10**9 + 7)
ans = 0

for i in range(N):
    Asum = Asum - A[i]
    ans += A[i]*Asum % (10**9 + 7)
    ans = ans % (10**9 + 7)

print (ans)
# Judge status: Accepted
a,b=map(int,input().split())
for i in range(10**5):
    if (i*2)//25==a and i//10==b:
        print(i)
        break
else:
    print(-1)
# Judge status: Accepted
import sys
input = sys.stdin.readline

N, W = [int(x) for x in input().split()]
wv = []
for _ in range(N):
    wv.append([int(x) for x in input().split()])

dp = [[0] * (W + 1) for _ in range(N + 1)]

for i in range(N):
    for j in range(W + 1):
        w, v = wv[i]
        if j >= w:
            dp[i + 1][j] = max(dp[i][j], dp[i][j - w] + v)
        else:
            dp[i + 1][j] = dp[i][j]

print(dp[N][W])
# Judge status: Wrong Answer
from collections import defaultdict

N = int(input())
if N == 1:
    print(0)
    exit()

index = int(pow(N, 0.5) + 1)
ans = []
for i in range(2, index):
    while N % i == 0:
        N //= i
        ans.append(i)
if ans == []:
    print(1)
    exit()
d = defaultdict(int)
for i in ans:
    d[i] += 1

anscnt = 0

for v, c in d.items():
    cnt = 1
    while c > 0:
        c -= cnt
        cnt += 1
        if c < 0:
            break
        anscnt += 1

print(anscnt)
# Judge status: Accepted
H1, M1, H2, M2, K = list(map(int, input().split()))

time1 = H1 * 60 + M1
time2 = H2 * 60 + M2
time3 = time2 - K

if time3 < time1: print(0)
else: print(time3 - time1)
# Judge status: Accepted
#!/usr/bin/env python3
S = input()
count = 0
for i in range(len(S)//2):
    if S[i] != S[-i-1]:
        count += 1
print(count)
# Judge status: Accepted
N = input()
if N.isupper():
    print('A')
else:
    print('a')
# Judge status: Accepted
x,y = map(int,input().split())
i = 2
cnt = 0
while 1:
    if x > y:
        break
    x *= 2
    cnt += 1
print(cnt)
# Judge status: Accepted
N,x = map(int, input().split())
A = list(map(int, input().split()))

A.sort()
ans = 0

for i in range(N):
  if x > A[i]:
    if i+1 == N:
      print(N-1)
      exit()
    else:
      ans += 1
      x -= A[i]
  elif x == A[i]:
    ans += 1
    print(ans)
    exit()
  else:
    print(ans)
    exit()
# Judge status: Wrong Answer
N, X, Y = map(int, input().split())
d = Y-X
c = []
for i in range(1,N):
  for j in range(i+1,N+1):
    if i == X and j == Y:
      c.append(1)
    elif j-i<=d:
      c.append(j-i)
    else:
      c.append(j-i-d+1)
for i in range(1,N):
  ans = c.count(i)
  print(ans)
# Judge status: Accepted
def median(q):
    l=len(q)
    q=sorted(q,reverse=True)
    if l%2==0:
        return (q[int(l/2)]+q[int(l/2)-1])/2
    else:
        return q[int((l+1)/2-1)]

n=int(input())

a=[]
b=[]

for i in range(n):
   x,y=map(int,input().split())
   a.append(x)
   b.append(y)
   
med_a=median(a)
med_b=median(b)

if n%2==0:
    print(int(2*(med_b-med_a)+1))
    
else:
    print((med_b-med_a)+1)
# Judge status: Wrong Answer
w,h,x,y = map(int,input().split())

left = x * h
right = (w - x)*h
tatemin = min(left,right)

under = w * y
top = w * (h - y)
yokomin = min(under,top)

bigger = max(tatemin,yokomin)

if tatemin == yokomin:
    print(bigger,1)
else:
    print(bigger,0)
# Judge status: Accepted
a,b=input().split()
a=int(a)
b=int(b.replace('.',''))
ans=int(a*b)
print(ans//100)
# Judge status: Wrong Answer
N=int(input())
D=list(map(int,input().split()))
mod=99824453

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


B=[0]*N
for d in D:
    B[d]+=1
if B[0]!=1:
    print(0)
    exit()

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

if total==N:
    print(ans)
else:
    print(0)
# Judge status: Accepted
n, a, b = map(int, input().split())

if n == 1 and a != b: print(0)
elif a > b: print(0)
else: print((n-2) * (b - a) + 1)
# Judge status: Accepted
a,b,c = map(int,input().split())
print(min((a%2)*b*c,(b%2)*a*c,(c%2)*b*a))
# Judge status: Accepted
def gcd(x, y):
  while y:
    x, y = y, x%y
  return x

A, B, C = map(int, input().split())

if  C % gcd(A, B) == 0 :
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
s = input()

for i in range(len(s)):
    if i % 2 == 0 and (s[i] != "L" and s[i] != "U" and s[i] != "D"):
        print("NO")
        break
    elif i % 2 == 1 and (s[i] != "R" and s[i] != "U" and s[i] != "D"):
        print("NO")
        break
    else:
        print("YES")
        break
# Judge status: Wrong Answer
a,b = map(int,input().split())
n = b-a

print(n*(n+1)/2 - b)
# Judge status: Wrong Answer
N=int(input())

for i in range(N):
    t,x,y = map(int,input().split())
    if ((x+y+t)%2 != 0) & (abs(x+y)>t):
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
K, S = map(int, input().split())
c = 0
for x in range(K+1):
    for y in range(K+1):
        if 0 <= (S-x-y) <= K:
            c += 1
print(c)
# Judge status: Accepted
from collections import Counter

n = int(input())
Ans = Counter(input())
for i in range(n-1):
    Ans = Ans & Counter(input())

a = []
for key, value in Ans.items():
    a += [key] * value
a.sort()
print(''.join(a))
# Judge status: Accepted
import sys 
from collections import Counter
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = int(readline())
l = read().decode().split()
c = Counter(l)
 
max = c.most_common()[0][1]
ans = [i[0] for i in c.items() if i[1] >= max]
 
print('\n'.join(sorted(ans)))
# Judge status: Wrong Answer
a,b=input().split()
a,b=map(int,(a,b))
if a*b%2==0:
  print("EVEN")
else :
  print("0dd")
# Judge status: Accepted
a, b, c = map(int, input().split())

if b - a == c - b:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

ans = 0 if (a*b*c)%2 == 0 else int(a*b*c/max(a, b, c))
print(ans)
# Judge status: Accepted
N,M = map(int,input().split())
d = {i:0 for i in range(1,M+1)}

for _ in range(N):
  L = list(map(int,input().split()))[1:]
  for i in L:
    d[i] += 1
    
cnt = sum([1 for k,v in d.items() if v == N])
print(cnt)
# Judge status: Accepted
N=int(input())
*A,=map(int,input().split())
ans=0
i=0
while i<N:
    if i%2==0 and A[i]%2==1:
        ans+=1
    i+=1
print(ans)
# Judge status: Accepted
import numpy as np

S=input()

if S[0]!=S[1] and S[1]!=S[2] and S[2]!=S[0]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import math
def gcd(a,b):
    if a==0: return b
    return gcd(b%a,a)
def div(n):
    cnt = 0
    temp = n
    for i in range(2,int(math.sqrt(n))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
            cnt += 1
    if temp!=1:
        cnt+=1
    return cnt+1

a,b = map(int,input().split())
print(div(gcd(a,b)))
# Judge status: Accepted
S=list(input())
if S[0]==S[1] and S[0]==S[2]:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
from collections import Counter
N = int(input())
Ac = Counter(list(map(int, input().split())))
sticks = sorted({k:v for k, v in Ac.items() if v >= 2}.items())[::-1]
if len(sticks) == 0:
    print(0)
else:
    if sticks[0][1] >= 4:
        print(sticks[0][0]**2)
    else:
        print(sticks[0][0]*sticks[1][0])
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
mx = 0


print(b*d)
# Judge status: Wrong Answer
from math import ceil
n,k=map(int,input().split())
L=list(map(int,input().split()))
print(ceil(n/(k-1)) if n!=k else "1")
# Judge status: Wrong Answer
x = int(input())
for i in range(1,100)[::-1]:
  if i*i <= x:
    print(i*i)
    exit()
# Judge status: Accepted
n,k = map(int,input().split())
a_ = list(map(int,input().split()))
if (n-1)%(k-1) == 0:
    print((n-1)//(k-1))
else:
    print((n-1)//(k-1)+1)
# Judge status: Accepted
N = int(input())

if N < 1000:
    print('ABC')
else:
    print('ABD')
# Judge status: Wrong Answer
N = int(input())
str = input()
i, j, k = [], [], []
total = 0
for n in range(N):
    if str[n]=='R':
        i.append(n+1)
    elif str[n]=='G':
        j.append(n+1)
    else:
        k.append(n+1)

for I in i:
    for J in j:
        total += 1 if not(J*2-I in k) else 0
print(total)
# Judge status: Accepted

import math

N,H = map(int, input().split())
A = 0
B = []
for i in range(N):
  a,b = map(int, input().split())
  A = max(A, a)
  B.append(b)

B.sort(reverse=True)

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

ans = H+1
for i in range(N+1):
  if H - accum_B[i] <= 0:
    ans = min(ans, i)
  else:
    ans = min(ans, i + math.ceil((H - accum_B[i]) / A))

print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())
cnt = 0
if n > m // 2:
    cnt += m // 2
    m -= m // 2
    n = 0
else:
    cnt += n
    m -= n * 2
    n = 0
cnt += m // 4
print(cnt)
# Judge status: Accepted
import fractions
import math
from collections import Counter
a, b = map(int, input().split())
n = fractions.gcd(a, b)

prime_count = Counter()
for i in range(2, math.ceil(math.sqrt(n))+1):
  while n % i == 0:
    n /= i
    prime_count[i] += 1
if n > 1:
  prime_count[int(n)] += 1

print(len(prime_count)+1)
# Judge status: Accepted
s = input()
t = input()

s = sorted(s)
t = sorted(t, reverse=True)

s_asc = ''.join(s)
t_desk = ''.join(t)

if s_asc < t_desk:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
mod = int(1e9) + 7
print(pow(10, N, mod) - pow(9, N, mod) - pow(9, N, mod) + pow(8, N, mod))
# Judge status: Accepted
a,b = map(int,input().split())
s = input()
s1 = s[0:a]
s2 = s[a]
s3 = s[a + 1:a + b + 1]
if "-" not in s1 and s2 == "-" and "-" not in s3:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
cnt = [0] *100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1

print(max(cnt))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a, b, c = map(int,input().split())
    k = int(input())
    cunt = 0
    while a >= b:
        b *= 2
        cunt += 1
    while b >= c:
        c *= 2
        cunt += 1
    if cunt > k:
        print("No")
    else:
        print("Yes")
    


if __name__=='__main__':
    main()
# Judge status: Accepted
n = int(input())
sum = 0
for i in range(n + 1):
    if i % 3 != 0 and i % 5 != 0 and i % 15 != 0:
        sum += i
print(sum)
# Judge status: Wrong Answer
N=int(input())
l=[int(x) for x in input().rstrip().split()]
rate=[False]*8
cnt=0

for i in l:
    for j in range(1,8+1):
        if 3200<=i:
            cnt+=1
            break
            
        if i<=j*400-1:
            rate[j-1]=True
            break

print(sum(rate),sum(rate)+cnt)
# Judge status: Accepted
import sys
input = sys.stdin.readline

n=int(input())
a=list(map(int,input().split()))
b={}
cnt=0
for i in a:
    if i<3200:
        b[i//400]=1
    else:
        cnt+=1
if sum(b.values())==0:
    print(1,cnt)
    exit()
print(sum(b.values()),sum(b.values())+cnt)
# Judge status: Wrong Answer
n = int(input())
x = n % 4
y = n % 7
if n%4 == 0 or n%7 == 0 or x%7 == 0 or y%4==0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
def ABC116B(s):
    if s % 2 == 0:
        return s//2
    else:
        return 3*s+1

s = int(input())
p = 1
a = False#二回目の4の判断
while True:
    s = ABC116B(s)
    p += 1
    if s == 4:
        if a:
            print(p)
            break
        else:
            a = True
# Judge status: Wrong Answer
x = int(input())
ans = x // 11

if 0 < ans * 11 < x:
  ans = ans * 2 + 1
else: ans = ans * 2
if ans == 0:
  if 6 > x: ans = 1
  elif 11 > x: ans = 2

print(ans)
# Judge status: Wrong Answer
n,m = map(int, input().split())
a = [int(input()) for _ in range(m)]

large = 10**9 +7
count = [0]*(n+1)
itr = 0
count[0] = 1

if m >0 and a[0] != 1 :
    count[1] = 1
else:
    count[1] = 0
    itr = 1

for i in range(2,n+1):
    if m > 0 and itr<len(a) and a[itr] == i:
        itr +=1
        continue
    else:
        count[i] = (count[i-1] + count[i-2])%large

print(count[n])
# Judge status: Accepted
s=input()
b=''.join(sorted(s))
if b=="abc":
  print("Yes")
else:
  print("No")
# Judge status: Accepted
A,B,X = map(int, input().split())
if A <= X < A+B:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
S = list(input())
Ki = S[::2]
Gu = S[1::2]
count=0
for i,k in zip(S[::2],S[1::2]):
    if k=='R'or i=='L':
        print('No')
        break
else:
    print('Yes')
# Judge status: Accepted
K, N = map(int, input().split())
A = [int(i) for i in input().split()]
dist = [A[i + 1] - A[i] for i in range(N - 1)]
dist.append(A[0] + K - A[N - 1])
print(K - max(dist))
# Judge status: Wrong Answer
N = int(input())
scores = sorted([int(input()) for i in range(N)])[::-1]


def get_max(nums):
    for num in nums:
        if num % 10 == 0:
            continue
        return num
    return 0


# accumulateは使わない
accum = [scores[0]]
# 降順で数字を足し込んでいく（後半になるほど増加分を少なくする）
for i in range(1, N):
    accum.append(accum[i-1] + scores[i])

# 逆順にすることでスキップしたときの減少を抑える
print(get_max(accum[::-1]))
# Judge status: Wrong Answer
import math

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

hh = h * 30
mm = m * 6
do = max(hh, mm) - min(hh, mm)
do = min(do, 360 - do)
sin = math.sin(math.radians(do))
if do == 90:
    print(math.sqrt(a ** 2 + b ** 2))

elif do > 90:
    hi = b * sin
    a_sub = math.sqrt(b ** 2 - hi ** 2)
    hy = math.sqrt((a + a_sub) ** 2 + hi ** 2)
    print(hy)

elif do < 90:
    hi = b * sin
    a_sub = math.sqrt(b ** 2 - hi ** 2)
    hy = math.sqrt((a_sub - a) ** 2 + hi ** 2)
    print(hy)
# Judge status: Accepted
l = list(map(int,input().split()))

n = len(set(l))
if n == 2:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
h,a = list(map(int, input().split())) 
import math
print(math.ceil(h/a))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
ans=[-1 for _ in range(n)]
for i in range(n):
  j=n-i
  if n//j<2:
    ans[j-1]=a[j-1]
  else:
    p=sum(ans[2*j-1::j])
    ans[j-1]=abs(a[j-1]-p)%2
b=[0 for _ in range(sum(ans))]
i=0
#print(ans)#######
m=sum(ans)
for j in range(n):
  if ans[j]!=1 and ans[j]!=0:
    print(-1)
    exit()
  if ans[j]==1:
    b[i]=j+1
    i+=1

print(m)
print(*b)
# Judge status: Accepted
n,m=map(int,input().split())
A=[list(map(int,input().split()))for i in range(n)]
A=sorted(A,key=lambda y:y[0])
cnt=0#ドリンクの本数
ans=0
for i in range(n):
    cnt+=A[i][1]
    if m<=cnt:
        over=cnt-m #mを超えた時の超過本数
        ans+=(A[i][0]*A[i][1])-(over*A[i][0])
        break
    else:
        ans+=A[i][0]*A[i][1]
print(ans)
# Judge status: Wrong Answer
S = input()
T = input()

if S == T:
    print('Yes')
l = len(S)
L = list(S)
for i in range(l):
    a = L[0]
    del L[0]
    L.append(a)
    s = ''.join(L)
    if s == T:
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
from decimal import *
getcontext().prec = 50
a,b,c = map(int,input().split())

if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from math import ceil
lst = []
ten = []
for i in range(5):
  t = int(input())
  if t % 10 == 0:
    ten.append(t)
  else:
    lst.append(t)
if lst == []:
  print(sum(ten))
  exit()
x = min(lst, key=lambda x: x % 10)
lst.remove(x)
for i in range(len(lst)):
  lst[i] = 10 * (lst[i] // 10 + 1)
print(x + sum(lst) + sum(ten))
# Judge status: Wrong Answer
n = int(input())
s = input()
ch = []
for i in range(1, n):
    x = s[:i+1]
    y = s[i:len(s)]
    a = set(x)
    b = set(y)
    c = a.intersection(b)
    ch.append(len(c))
print(max(ch))
# Judge status: Wrong Answer
r,g,b = input().split()
is_four_multiple = g+b
if int(is_four_multiple) % 4 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
A,B,K = map(int,input().split())
count = 0
for i in range(101,0,-1):
  if A%i == 0 and B%i == 0:
    count += 1
    print(i)
    if count == K:
      print(i)
      exit()
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
ans = 1
i = 0
cnt = 0
while i < n-1:
    if A[i] == A[i+1]:
        ans *= A[i]
        i += 2
        cnt += 1
    else:
        i += 1
    if cnt == 2:
        print(ans)
        exit(0)
print(0)
# Judge status: Accepted
import numpy

if __name__ == "__main__":
	hour_len, min_len, hours, minutes = map(int, input().strip().split(' '))
	angle_minute = 2 * numpy.pi * (minutes / 60)
	angle_hour = 2 * numpy.pi * (((hours * 60) + minutes) / 720)
	if angle_hour >= angle_minute:
		final_angle = angle_hour - angle_minute
	elif angle_minute > angle_hour:
		final_angle = angle_minute - angle_hour
	answer = (hour_len * hour_len) + (min_len * min_len) - (2 * min_len * hour_len * numpy.cos(final_angle))
	print(numpy.sqrt(answer))
# Judge status: Accepted
a, b, k = map(int, input().split())

dividors = []
for i in range(1, max(a, b) + 1):
    if a % i == 0 and b % i == 0:
        dividors.append(i)

print(dividors[::-1][k - 1])