Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(H: int, W: int, s: "List[str]"):
    print(YES if all(
        any(
            s[y + dy][x + dx] == "#"
            for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]
            if 0 <= x + dx < W and 0 <= y + dy < H
        )
        for y in range(H)
        for x in range(W)
        if s[y][x] == "#"
    ) else NO)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(W)]  # type: "List[str]"
    solve(H, W, s)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(H: int, W: int, s: "List[str]"):
    print(YES if all(
        any(
            s[y + dy][x + dx] == "#"
            for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]
            if 0 <= x + dx < W and 0 <= y + dy < H
        )
        for y in range(H)
        for x in range(W)
        if s[y][x] == "#"
    ) else NO)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(H)]  # type: "List[str]"
    solve(H, W, s)


if __name__ == '__main__':
    main()
import sys
from itertools import islice, repeat


def _resolve(costs, k):
    sum_ = sum(costs)
    v = 0
    if k >= len(costs):
        if sum_ > 0:
            x = k // len(costs) - 1
            v = x * sum_
            k -= x * len(costs)
        else:
            k = len(costs)

    points = [v] * (len(costs) * (k + 1))
    for i in range(k):
        for n in range(len(costs)):
            points[(i + 1) * len(costs) + n] = points[i * len(costs) + n] + costs[(i + n) % len(costs)]
    
    ans = max(points)
    if ans == 0:
        y = max(costs)
        if y < 0:
            ans = y
    return ans


def resolve(in_):
    N, K = map(int, next(in_).split())
    P = list(map(int, next(in_).split())
    C = [0] + list(map(int, next(in_).split()))

    graphs = []
    p = set(P)
    while p:
        index = p.pop()
        graph = [C[index]]
        index = P[index]
        while index in p:
            graph.append(C[index])
            p.remove(index)
            index = P[index]
        graphs.append(graph)

    ans = max(map(_resolve, graphs, repeat(K)))
    return ans


def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from itertools import islice, repeat


def _resolve(costs, k):
    sum_ = sum(costs)
    v = 0
    if k >= len(costs):
        if sum_ > 0:
            x = k // len(costs) - 1
            v = x * sum_
            k -= x * len(costs)
        else:
            k = len(costs)

    points = [v] * (len(costs) * (k + 1))
    for i in range(k):
        for n in range(len(costs)):
            points[(i + 1) * len(costs) + n] = points[i * len(costs) + n] + costs[(i + n) % len(costs)]
    
    ans = max(points)
    if ans == 0:
        y = max(costs)
        if y < 0:
            ans = y
    return ans


def resolve(in_):
    N, K = map(int, next(in_).split())
    P = [0] + list(map(int, next(in_).split()))
    C = [0] + list(map(int, next(in_).split()))

    graphs = []
    p = set(P[1:])
    while p:
        index = p.pop()
        graph = [C[index]]
        index = P[index]
        while index in p:
            graph.append(C[index])
            p.remove(index)
            index = P[index]
        graphs.append(graph)

    ans = max(map(_resolve, graphs, repeat(K)))
    return ans


def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    exit(0)
if 10**18 < ans:
    print(-1)


### FIXED CODE ###

import sys  # sys.exit()を使いたいので

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

if 0 in a:
# 0が1つでもあれば0です
    print(0)
else:
# 0がない場合
    cur = 1  # 現在の数値
    for x in a:
        cur *= x
        if cur > 10 ** 18:
        # 10**18を超えたので終了します
            print(-1)
            sys.exit()
    print(cur)  # 10**18以下なので、出力します
N, K = map(int, input().split())
menu = []

for i in range(N):
    t, d = map(int, input().split())
    menu.append((t, d))

menu = sorted(menu, key = lambda x:x[1], reverse=True)
neta = set()
duplicates = []

for m in menu[:K]:
    if m[0] in neta:
        duplicates.append(m[1])
    else:
        neta.add(m[0])

p = sum([d for (t, d) in menu[:K]]) + len(neta)**2
ans = p

for m in menu[K:]:
    if m[0] not in neta:
        neta.add(m[0])
        duplicate = duplicates.pop()
        
        p += (m[1] - duplicate) + 2 * len(neta) - 1 
        #print(ans, p)
        ans = max(ans, p)

print(ans)   

### FIXED CODE ###

N, K = map(int, input().split())
menu_ = []

for i in range(N):
    t, d = map(int, input().split())
    menu_.append((t, d))

menu = sorted(menu_, key = lambda x:x[1], reverse=True)
neta = set()
duplicates = []

for m in menu[:K]:
    if m[0] in neta:
        duplicates.append(m[1])
    else:
        neta.add(m[0])

p = sum([d for (t, d) in menu[:K]]) + len(neta)**2
ans = p

for m in menu[K:]:
    if m[0] not in neta and duplicates:
        neta.add(m[0])
        duplicate = duplicates.pop()
        
        p += (m[1] - duplicate) + 2 * len(neta) - 1 
        #print(ans, p)
        ans = max(ans, p)

print(ans)
import numpy as np
N, M = map(int, input().split())
A = np.array([int(input()) for _ in range(M)], dtype = int)

MOD= 1000000007
dp = np.zeros(N, dtype = int)
if M != 0:
    dp[A - 1] = -1

if dp[0] == -1 and dp[1] == -1:
    pass
elif dp[0] == -1:
    dp[1] = 1
# elif dp[1] == -1:
#     dp[0] = 1
else:
    dp[0] = 1
    dp[1] = 2


if N >= 3:
    for n in range(2, N):
        if dp[n] != -1:
            dp[n] = (max(dp[n-1], 0) + max(dp[n-2], 0)) % MOD

print (dp[-1])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
import numpy as np
N, M = map(int, input().split())

MOD = 1000000007
dp = np.zeros(N, dtype = int)
if M != 0:
    A = np.array([int(input()) for _ in range(M)], dtype = int)
    dp[A - 1] = -1


if dp[0] == -1 and dp[1] == -1:
    pass
else:
    if dp[0] == -1:
        dp[1] = 1
    elif N >= 2 and dp[1] == -1:
        dp[0] = 1
    elif N >= 2:
        dp[0] = 1
        dp[1] = 2
    else:
        dp[0] = 1


if N >= 3:
    for n in range(2, N):
        if dp[n] != -1:
            dp[n] = (max(dp[n-1], 0) + max(dp[n-2], 0)) % MOD

print (dp[-1])
k,x = map(int,input().split())
list=[x-(k-1)+i for i in range(2*k-1)]
print(' '.join(list))

### FIXED CODE ###

k,x = map(int,input().split())
L=[x-(k-1)+i for i in range(2*k-1)]
print(' '.join(map(str, L)))
n=int(input())
for i in range(n):
   n[1]=n[i]
   s=sum(n)
   m=min(n)
   ma=max(n)
   print(m ma s)


### FIXED CODE ###

n=int(input())
r=input().split()
for i in range(len(r)):
    r[i]=int(r[i])
s=sum(r)
m=min(r)
ma=max(r)
print(m,ma,s)
def resolve():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input().split()
 
    if S == U:
        A -= 1
    else:
        B -= 1
 
    print(A + " " + B)
 
if __name__ == "__main__":
    resolve()

### FIXED CODE ###

def resolve():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

    if S == U:
        A -= 1
    else:
        B -= 1
 
    print(str(A) + " " + str(B))
 
if __name__ == "__main__":
    resolve()
list = input().split
X = list[0]
Y = list[1]

price = X + Y/2
print(price)

### FIXED CODE ###

list = input().split()
X = list[0]
Y = list[1]

price = round(int(X) + (int(Y)/2))
print(price)
a, b, c, d = map(int, input().split())
 
B-A = abs(b - a)
B-C = abs(c - b)
C-A = abs(a - c)
 
if (B-A <= d and B-C <= d) or C-A <= d:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

a,b,c,d = map(int,input().split())
B_A = abs(b - a)
C_B = abs(c - b)
C_A = abs(c - a)
if B_A <= d and C_B <=d:
    print('Yes')
elif C_A <= d:
    print('Yes')
else:
    print('No')
import sys
sys.setrecursionlimit(100000)

N,K = map(int, input().split())
MOD = 10**9+7
A = N - K + 1

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

print(N-K+1)
for i in range(1,K):
    print(cmb(K-1, i) * cmb(A, i+1) % MOD)


### FIXED CODE ###

#import sys
#sys.setrecursionlimit(100000)

N,K = map(int, input().split())
MOD = 10**9+7
A = N - K + 1

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

for i in range(K):
    if N - K - i >= 0:
        print(cmb(K-1, i) * cmb(A, i+1) % MOD)
    else:
        print(0)
n = int(input())
x = list(input())
y = x.count("1")
s, t = y - 1, y + 1
p = [1] * 20
for i in range(1, 20):
    p[i] = p[i - 1] * 2
p.sort(reverse = True)
a, b, u, v = 1 / 2, 1 / 2, 0, 0
m1, m2 = [0] * n, [0] * n
for i in range(1, n + 1):
    a += a
    a %= s
    b += b
    b %= t
    m1[i - 1] = a
    m2[i - 1] = b
    if x[-i] == "1":
        u += a
        v += b
ans = [1] * n
for i in range(1, n + 1):
    if x[-i] == "1":
        j = (u - m1[i - 1]) % s
    else:
        j = (v + m2[i - 1]) % t
    if not j == 0:
        while not j == 0:
            ans[-i] += 1
            l = j
            cnt = 0
            for k in p:
                if l == 0:
                    break
                if k <= l:
                    cnt += 1
                    l -= k
            j = j % cnt
for i in ans:
    print(i)

### FIXED CODE ###

n = int(input())
x = list(input())
y = x.count("1")
s, t = y - 1, y + 1
p = [1] * 20
for i in range(1, 20):
    p[i] = p[i - 1] * 2
p.sort(reverse = True)
a, b, u, v = 1 / 2, 1 / 2, 0, 0
m1, m2 = [0] * n, [0] * n
if not s == 0:
    for i in range(1, n + 1):
        a += a
        a %= s
        b += b
        b %= t
        m1[i - 1] = a
        m2[i - 1] = b
        if x[-i] == "1":
            u += a
            v += b
else:
    for i in range(1, n + 1):
        b += b
        b %= t
        m2[i - 1] = b
        if x[-i] == "1":
            v += b
ans = [1] * n
if not s == 0:
    for i in range(1, n + 1):
        if x[-i] == "1":
            j = (u - m1[i - 1]) % s
        else:
            j = (v + m2[i - 1]) % t
        if not j == 0:
            while not j == 0:
                ans[-i] += 1
                l = j
                cnt = 0
                for k in p:
                    if l == 0:
                        break
                    if k <= l:
                        cnt += 1
                        l -= k
                j = j % cnt
else:
    for i in range(1, n + 1):
        if x[-i] == "1":
            ans[-i] = 0
        else:
            j = (v + m2[i - 1]) % t
            if not j == 0:
                while not j == 0:
                    ans[-i] += 1
                    l = j
                    cnt = 0
                    for k in p:
                        if l == 0:
                            break
                        if k <= l:
                            cnt += 1
                            l -= k
                    j = j % cnt
for i in ans:
    print(i)
#!/usr/bin
# -*- coding="utf-8" -*-

c1 = []
c2 = []
q = input().split()
n = [input() for i in range(int(q[1]))]
for j in range(n):
  m = j.split()
  if m[0] == "1":
    c1.append(m[1])
  if m[1] == q[0]:
    c2.append(m[0])
if set(c1) & set(c2):
  print("POSSIBLE")
else:
  print("INPOSSIBLE")

### FIXED CODE ###

#!/usr/bin
# -*- coding="utf-8" -*-
c1 = []
c2 = []
q = input().split()
n = [input().split() for i in range(int(q[1]))]
 
for m in n:
  if m[0] == "1":
    c1.append(m[1])
  if m[1] == q[0]:
    c2.append(m[0])
if set(c1) & set(c2):
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")
import math
A,B=input().split()
print(A*B//math.gcd(A,B))

### FIXED CODE ###

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)
input()
s = 0
a = input()
a = map(int,a.split(" "))
for u in a:
    s=s+u

print(min(a),max(a),s)


### FIXED CODE ###

n = input()
s = 0
a = input()
b = a.split(" ")
c = []
for i in range(int(n)):
    c.append(int(b[i]))

for u in c:
    s=s+u

print(min(c),max(c),s)
n = inpt(input())
ans = 0
for i in range(1, n+1):
  stock = 0
  for j in range(1, n+1):
    if i % j == 0:
      stock += 1
  if stock == 8 and i % 2:
    ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0

for i in range(1, N+1):
	div_num = 0
	if i % 2:
		for j in range(1, i+1):
			if not i % j:
				div_num += 1
		if div_num == 8:
			ans += 1

print(ans)
k = int(input())
que = []
for i in range(1,10):
  que.append(i)
ct = 0
while(len(que) < k):
  ct += 1
  value = que[0]
  que.remove(value)
  for i in [-1,0,1]:
    if 0 <= (value%10) + i and (value%10) + i <= 9:
      tmp = 10*value + (value%10) + i
      q.append(tmp)  
print(que[k-1-ct])

### FIXED CODE ###

k = int(input())
que = []
for i in range(1,10):
  que.append(i)
ct = 0
while(len(que) < k):
  ct += 1
  value = que[0]
  que.remove(value)
  for i in [-1,0,1]:
    if 0 <= (value%10) + i and (value%10) + i <= 9:
      tmp = 10*value + (value%10) + i
      que.append(tmp)  
print(que[k-1-ct])
from functools import lru_cache
import sys
sys.setrecursionlimit(10 ** 6)


@lru_cache
def rec(i, j):
    if i < 0 or j < 0:
        return 0.0
    if i == 0 and j == 0:
        return 1.0
    global p
    return rec(i - 1, j) * (1 - p[i - 1]) + rec(i - 1, j - 1) * p[i - 1]


def main():
    N = int(input())
    global p
    p = list(map(float, input().split()))
    ans = 0
    for i in range(N // 2 + 1, N + 1):
        ans += rec(N, i)
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N = int(input())
    p = list(map(float, input().split()))
    dp = [[0 for _ in range(N + 1)] for _ in range(N + 1)]
    p_mul = 1
    dp[0][0] = 1
    for i in range(1, N + 1):
        p_mul *= (1-p[i-1])
        dp[i][0] = p_mul
    for i in range(1, N+1):
        for j in range(1, N+1):
            dp[i][j] = dp[i - 1][j] * \
                (1 - p[i - 1]) + dp[i - 1][j - 1] * p[i - 1]
    print(sum(dp[N][N//2+1:]))


if __name__ == "__main__":
    main()
A = Input()
B = Input()

if 1 <= A <= 9 and 1 <= B <= 9:
    print(A * B)
else:
    print(-1)


### FIXED CODE ###

A, B = map(int, input().split())
if 1 <= A <= 9 and 1 <= B <= 9:
    print(A * B)
else:
    print(-1)
print( x ** 3)

### FIXED CODE ###

x = int(input())
print( x ** 3)
n,k=map(int,input().split())
p=list(map(int,input().split()))

lst=[]
sum=0
for i in range(n):
    sum+=p[i]
    lst.append(sum)
    
ans=[]
for i in range(n-k):
    ans.append(lst[i+k]-lst[i])

print((max(ans)+k)/2)


### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))

lst=[0]
sum=0
for i in range(n):
    sum+=p[i]
    lst.append(sum)
    
ans=[]
for i in range(n-k+1):
    ans.append(lst[i+k]-lst[i])

print((max(ans)+k)/2)
import sys
N,M=list(map(int, input().split()))

s=[list(map(int, input().split())) for _ in range(M)]

a=["a" for _ in range(N+1)]

if len(s)==0 and N==1:
    print(0)
    sys.exit()
    
elif len(s)==0:
    print(10**(N-1))
    sys.exit()

for i in s:
    if i[1]==0 and i[0]==1:
        print(-1)
        sys.exit()
    

    
    if a[i[0]-1]=="a":
        a[i[0]-1]=str(i[1])
    
    elif a[i[0]-1]!="a" and a[i[0]-1]==str(i[1]):
        continue
        
    elif a[i[0]-1]!="a" and a[i[0]-1]!=str(i[1]):
        print(-1)
        sys.exit()

num=[int(i) if i!="a" else 0 for i in a ]
    
        
if N==1:
    print(int(num[2]))
elif N==2:
    ans=10*int(num[1])+int(num[2])
    if ans//10==0:
        ans+=10
    print(ans)
elif N==3:
    ans=100*int(num[0])+10*int(num[1])+int(num[2])
    
    if ans//100==0:
        ans+=100
    print(ans) 
        
        
    

### FIXED CODE ###

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

s=[list(map(int, input().split())) for _ in range(M)]

a=["a" for _ in range(N)]

if len(s)==0 and N==1:
    print(0)
    sys.exit()
    
elif len(s)==0:
    print(10**(N-1))
    sys.exit()

for i in s:
    if i[1]==0 and i[0]==1 and N!=1:
        print(-1)
        sys.exit()
   
    if a[i[0]-1]=="a":
        a[i[0]-1]=str(i[1])
    
    elif a[i[0]-1]!="a" and a[i[0]-1]==str(i[1]):
        continue
        
    elif a[i[0]-1]!="a" and a[i[0]-1]!=str(i[1]):
        print(-1)
        sys.exit()

num=[int(i) if i!="a" else 0 for i in a ]
    
if N==1:
    print(int(num[-1]))
elif N==2:
    ans=10*int(num[0])+int(num[1])
    if ans//10==0:
        ans+=10
    print(ans)
elif N==3:
    ans=100*int(num[0])+10*int(num[1])+int(num[2])
    
    if ans//100==0:
        ans+=100
    print(ans)
N, M = int(input())
set_a, set_b = set(), set()

for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        set_a.add(b)
    if b == N:
        set_b.add(a)

if set_a & set_b:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


### FIXED CODE ###

N, M = map(int, input().split())
set_a, set_b = set(), set()

for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        set_a.add(b)
    if b == N:
        set_b.add(a)

if set_a & set_b:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
x=[]
y=[]
for i in lst:
  if lst[0]==1:
    x+=[i[1]]
for i in lst:
  if lst[1]==n:
    y+=[i[0]]
ans='IMPOSSIBLE'
for i in x:
  if i in y:
    ans='POSSIBLE'
    break
print(ans)


### FIXED CODE ###

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

x=[]
y=[]

for i in lst:
  if i[0]==1:
    x+=[i[1]]
    
for i in lst:
  if i[1]==n:
    y+=[i[0]]
    
ans='POSSIBLE'

if len(list(set(x)))+len(list(set(y)))==len(list(set(x+y))):
  ans='IMPOSSIBLE'
    
print(ans)
N,K = int(input()), int(input())
S = input()

komoji = S[K-1:K].lower()

Out = S[:K-1] + komoji + S[K:N+1]

print(Out)

### FIXED CODE ###

N,K = (int(x) for x in input().split())
S = input()
if 1 <= N <= 50 and 1 <=K <= N and len(S) == N :
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)
N = int(input())
s = input()
l = input()
for i in range(1,N):
    if s[-i:]!=l[:i]:
        a=2*N-i+1
        break
print(a if s!=l else N)

### FIXED CODE ###

i=input;N=int(i());s=i();l=i();n=N;j=0
exec("j=max(n*(s[-n:]==l[:n]),j);n-=1;"*N);print(2*N-j)
xfrom collections import deque, defaultdict
N, X, Y = map(int, input().split())  # N個の頂点, XとYが繋がっている

graph = [[] for _ in range(N)]
for i in range(N-1):
    graph[i].append(i+1)
    graph[i+1].append(i)
X -= 1
Y -= 1
graph[X].append(Y)
graph[Y].append(X)
# print(graph)

# 最後に//2すれば良い
ans = defaultdict(int)
for i in range(N):
    q = deque()
    # 開始のノード
    q.append(i)
    visited = [False]*N
    visited[i] = True
    distant = [100000] * N
    distant[i] = 0
    while len(q):
        v = q.popleft()
        for e in graph[v]:
            if visited[e]:
                continue
            distant[e] = distant[v] + 1
            ans[distant[e]] += 1
            visited[e] = True
            q.append(e)
    # 始点iからの幅優先探索完了
# print(ans)
for i in range(1, N):
    print(ans[i]//2)


### FIXED CODE ###

from collections import deque, defaultdict

N, X, Y = map(int, input().split())
# 全探索でいけるのでは？
# 有向グラフとしてN回幅優先すれば良いのでは？
tree = [[] for _ in range(N)]
for i in range(N-1):
    tree[i].append(i+1)
    tree[i+1].append(i)
tree[X-1].append(Y-1)
tree[Y-1].append(X-1)
ans = defaultdict(int)
q = deque()
# 更新されない時はqに追加しない
for i in range(N):
    distant = [N]*N
    q.append(i)  # 始まりのノード
    distant[i] = 0
    while len(q):
        # vは数字, 親のノードのインデックス
        v = q.pop()
        for e in tree[v]:
            if distant[e] < distant[v]+1:  # 到達済みなら次のノードへ
                continue
            distant[e] = distant[v]+1
            q.append(e)
    for d in distant:
        ans[d] += 1
for i in range(1, N):
    print(ans[i]//2)
import math
a,b,x = map(int,input().split())
tan = a**3/(2*(a**2*b-x))
if tan<=(a/b):
    tan = 2*x/(b**2*a)
rad = math.atan(tan)
deg= 90- (rad * 180/math.pi)
print(deg)

### FIXED CODE ###

import math
import sys
a,b,x = map(int,input().split())
if a*a*b == x:
    print(0)
    sys.exit()
tan = a**3/(2*(a**2*b-x))
if tan<=(a/b):
    tan = 2*x/(b**2*a)
rad = math.atan(tan)
deg= 90- (rad * 180/math.pi)
print(deg)
N,K = map(int,(input().split()))
h = list(map(int,input().split()))

dp = [float("inf")]*len(h)
dp[0] = 0


for i in range(1, len(h)):
    for j in range(1,K+1):
        dp[i] = min(dp[i-j]+abs(h[i-1]-h[i-j-1]), dp[i])


print(dp[N-1])

### FIXED CODE ###

N,K = map(int,(input().split()))
h = list(map(int,input().split()))

dp = [float("inf")]*len(h)
dp[0] = 0

for i in range(len(h)):
    for j in range(1,min(i+1,K+1)):
        dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]), dp[i])
        
print(dp[N-1])
N,K=map(int,input().split())
S=input()
S[K-1]=S.lower()[K-1]
print(S)

### FIXED CODE ###

N,K=map(int,input().split())
S=list(input())
S[K-1]=S[K-1].lower()
S="".join(S)
print(S)
n = int(input())
a = list(map(int, input().split()))

ans = 0
double = 0

for i in a:
    double += i*i

ans = (sum(a) * sum(a) - double) // 2
print((ans % (10**9 + 7))

### FIXED CODE ###

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

ans = 0
double = 0

for i in a:
    double += i*i

ans = (sum(a) * sum(a) - double) // 2
print(ans % (10**9 + 7))
from math import gcd
a,b = map(int,input().split())
print(int(a*b/gcd(a,b)))


### FIXED CODE ###

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

def gcd(m,n):
    x=max(m,n)
    y=min(m,n)
    if x%y==0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x=y
            y=z
        else:
            return z

ans=a*b/gcd(a,b)
print(int(ans))
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = min(a)+min(b)

for _ in range(M):
    x, y, c = map(int, input().split())
    ans = min(a[x-1]+b[y-1]-c, ans)

prins(ans)

### FIXED CODE ###

A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = min(a)+min(b)

for _ in range(M):
    x, y, c = map(int, input().split())
    ans = min(a[x-1]+b[y-1]-c, ans)

print(ans)
N = int,input()
a = [int(input()) for i in range(N)]
li_uniq = list(set(a))
print(len(li_uniq))

### FIXED CODE ###

N = int(input())
a = [int(input()) for i in range(N)]
li_uniq = list(set(a))
print(len(li_uniq))
ggg


### FIXED CODE ###

s = input()
 
print(int(s[0])+int(s[1])+int(s[2]))
a = []
for i in range(0,4):
  a.append(input())
k =int(input())
if k <= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')
  


### FIXED CODE ###

a = []
for i in range(5):
  a.append(int(input()))
  
k =int(input())
if k >= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')