Harryxun/stf_run huggingface dataset:
import numpy as np
n,k = map(int, input().split())
a = list(map(int, input().strip().split()))
a = np.array(a)
a -= 1
#print(a)
visited = [-1] * (n+1)


now = 0
visited[0] = 0
pre_roop = 0
pos = 0
i = 1
while i < k:
    next = a[now]
    #print('roop:',i,now+1,next+1)
    if visited[next] >= 0:
        r = i-visited[next]
        pre_roop = visited[next]
        pos = next
        #print(i,r,pre_roop,next)
        #print(visited)
        break
    else:
        visited[next] = i
        now = next
        #print(i,visited)
        i += 1
l = (k - pre_roop) % r
#print(l)
i = 0
p = pos
while i < l:
    p = a[p]
    i +=1

print(p+1)



### FIXED CODE ###

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

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

visited = [-1] * n
now = 0
visited[0] = 0
pre_roop = 0
pos = 0
i = 1
r = 1
while i <= k:
    next = a[now]
    #print('roop:',i,now+1,next+1)
    if visited[next] >= 0:
        r = i-visited[next]
        pre_roop = visited[next]
        pos = next
        #print(i,r,pre_roop,next)
        #print(visited)
        break
    else:
        visited[next] = i
        now = next
        #print(i,visited)
        i += 1

if i > k:
    print(now + 1)
else:
    l = (k - pre_roop) % r
    #print(l)
    i = 0
    p = pos
    while i < l:
        p = a[p]
        i +=1

    print(p+1)
import sys
import math
x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  sys.exit()
n=(x+y)//3
print(math.factorial(n)//math.factorial(x-n)//math.factorial(y-n))

### FIXED CODE ###

import sys
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  sys.exit()
n=(x+y)//3

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

print(cmb(n,x-n,mod))
n,m = map(int, input().split())
mod = 10**9+7

lst = []
for i in range(m):
    lst.append(int(input()))
lst.sort()

#2連続穴がある場合
for i in range(len(lst)-1):
    if lst[i]+1 == lst[i+1]:
        print(0)
        exit()

lst2 = []
for i in range(len(lst)):
    if i==0:
        lst2.append(lst[0]-1)
    else:
        lst2.append(lst[i]-lst[i-1]-2)
lst2.append(n-lst[-1]-1)



dp = [0 for i in range(n)]
dp[0] = 1
dp[1] = 1
for i in range(2,n):
    dp[i] = dp[i-1] + dp[i-2]

ans = 1
for i in lst2:
    ans *= dp[i]
    ans %= mod

print(ans)


### FIXED CODE ###

n,m = map(int, input().split())
mod = 10**9+7

#フィボナッチ数列
dp = [0 for i in range(n+2)]
dp[0] = 1
dp[1] = 1
for i in range(2,n+2):
    dp[i] = dp[i-1] + dp[i-2]

#穴が無い場合
if m==0:
    print(dp[n]%mod)
    exit()

lst = []
for i in range(m):
    lst.append(int(input()))
lst.sort()

#2連続穴がある場合
for i in range(len(lst)-1):
    if lst[i]+1 == lst[i+1]:
        print(0)
        exit()

lst2 = []
for i in range(len(lst)):
    if i==0:
        lst2.append(lst[0]-1)
    else:
        lst2.append(lst[i]-lst[i-1]-2)
lst2.append(n-lst[-1]-1)

ans = 1
for i in lst2:
    ans *= dp[i]
    ans %= mod

# print(lst)
# print(lst2)
print(ans)
import math

N = int(input())
for i in range(N):
    a = int(input())
    b = int(input())
    if math.log10(a) > 79 or math.log10(b) > 79 or math.log10(a + b) > 79:
        print("overflow")
    else:
        print(a + b)

### FIXED CODE ###

import math

N = int(input())
for i in range(N):
    a = int(input())
    b = int(input())
    if a >= 10 ** 80 or b >= 10 ** 80 or a + b >= 10 ** 80:
        print("overflow")
    else:
        print(a + b)
a = int(input())
b = list(map(int, input().split()))
for i in range(1,a+1):
  n = 0
  for j in b:
    if i == j:
      n = n + 1
      print(n)

### FIXED CODE ###

def main():
    pi = 3.14159265
    r = int(input())
    print(2*pi*r)

if __name__ == '__main__':
    main()
import math
A, B, C, D, E, F = map(int,input().split())
w_max = 30

def reduce(x): #約分
  #print(x)
  d = math.gcd(x[0], x[1])
  return (x[0] // d, x[1] // d)

def is_valid(s, w): #砂糖s、水100w
  return s <= w * E and s + 100*w <= F

ratios = set()

Waters = [] 
for a in range(0, w_max, A):
  for b in range(0, w_max, B):
    if a == 0 and b == 0:
      continue
    Waters.append(a+b)
Waters.sort()

s_max = 0
for x in Waters:
  s_max = max(s_max, min(x*E,F-100*x))

Sugars = [] 
for c in range(0, s_max, C):
  for d in range(0, s_max, D):
    Sugars.append(c+d)
Sugars.sort()

i = 0
ascend = True
for w in Waters:
  if Sugars[i]*100 + w > F:
    ascend = False
  if ascend:
    while i < len(Sugars) and is_valid(Sugars[i], w):
      i += 1
    i -= 1
  else:
    while i >= 0 and not is_valid(Sugars[i], w):
      i -= 1
  ratios.add(reduce((Sugars[i], w)))

ans = max(ratios, key = lambda x: float(x[0]/x[1]))
print(ans[1]*100 + ans[0], ans[0])
  
  
  
  
  

### FIXED CODE ###

import math
A, B, C, D, E, F = map(int,input().split())
w_max = 30

def reduce(x): #約分
  #print(x)
  d = math.gcd(x[0], x[1])
  return (x[0] // d, x[1] // d)

def is_valid(s, w): #砂糖s、水100w
  return s <= w * E and s + 100*w <= F

ratios = set()
recipe = {}

Waters = [] 
for a in range(0, w_max+1, A):
  for b in range(0, w_max+1, B):
    if (a == 0 and b == 0) or a + b > F:
      continue
    Waters.append(a+b)
Waters.sort()

s_max = 0
for x in Waters:
  s_max = max(s_max, min(x*E,F-100*x))

Sugars = [] 
for c in range(0, s_max+1, C):
  for d in range(0, s_max+1, D):
    Sugars.append(c+d)
Sugars.sort()

i = 0
ascend = True
for w in Waters:
  while i >= 0 and not is_valid(Sugars[i], w):
    i -= 1
  while 0 <= i < len(Sugars) and is_valid(Sugars[i], w):
    i += 1
  i -= 1
  if i >= 0:
    ratios.add(reduce((Sugars[i], w)))
    recipe[reduce((Sugars[i], w))] = (Sugars[i], w)

ans = recipe[max(ratios, key = lambda x: float(x[0]/x[1]))]
print(ans[1]*100 + ans[0], ans[0])
a,b,c = input().split()
if b=='+':
  print(int(a)+int(c))
else:
  print(int(a)-int(b))

### FIXED CODE ###

a,b,c = input().split()
if b=='+':
  print(int(a)+int(c))
else:
  print(int(a)-int(c))
import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

N = int(input())


if N%2 == 1:
    print(0)
    exit()

v = math.log(N, 5)

l = [i for i in range(1, math.floor(v+1))]
ll = [2*5**i for i in l]
lll = [N//i for i in ll]
print(sum(lll))

### FIXED CODE ###

import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]


N = int(input())
if N % 2:
    print(0)
    exit()
else:
    N //= 2

ans = 0
while N > 0:
    N //= 5
    ans += N
print(ans)
L,R=map(int,input().split())
min=0
result=[]
num_range=R-L
print(num_range)
for i in range(num_range-1):
    for j in range(i+1,num_range):
        if (L+i)>=2019 and (L+j)>=2019:
            result.append((L+i-2019)*(L+j-2019))
        else: result.append(L*R)    
result.sort()
print(result[0])

### FIXED CODE ###

L,R=map(int,input().split())
if R-L>=2018:
    print(0)
else:
    ans=2019
    for i in range(L,R):
        for j in range(i+1,R+1):
            ans=min(ans,i*j%2019)
    print(ans)
import sys
input = sys.stdin.readline
H,W,D = map(int,input().split())
A = [list(map(int,input().split())) for i in range(H)]
Q = int(input())
LR = [tuple(map(int,input().split())) for i in range(Q)]

INF = float('inf')
h = 0--(H*W)//D
pos = [[INF]*h for _ in range(D)]
for i,row in enumerate(A):
    for j,a in enumerate(row):
        d,m = divmod(a,D)
        pos[m][d] = (i,j)

dists = [[0] for _ in range(D)]
for i,p in enumerate(pos):
    for p1,p2 in zip(p,p[1:]):
        if p1==INF or p2==INF: continue
        a1,b1 = p1
        a2,b2 = p2
        dist = abs(a1-a2) + abs(b1-b2)
        dists[i].append(dists[i][-1] + dist)

ans = []
for l,r in LR:
    a,i = divmod(l,D)
    b,j = divmod(r,D)
    if i==0:
        a-=1; b-=1
    ans.append(dists[i][b] - dists[i][a])
print(*ans, sep='\n')

### FIXED CODE ###

H,W,D = map(int,input().split())
src = [list(map(int,input().split())) for i in range(H)]
Q = int(input())
qs = [tuple(map(int,input().split())) for i in range(Q)]

pos = [[None for i in range(D)] for j in range(H*W//D + 1)]
for y in range(H):
    for x in range(W):
        a = src[y][x]
        b,c = a//D, a%D
        pos[b][c] = (x,y)

cums = [[0] for i in range(D)]
for i in range(D):
    for j in range(H*W//D):
        if pos[j][i] is None or pos[j+1][i] is None:
            cums[i].append(cums[i][-1])
        else:
            x1,y1 = pos[j][i]
            x2,y2 = pos[j+1][i]
            dist = abs(x1-x2) + abs(y1-y2)
            cums[i].append(cums[i][-1] + dist)
            
for l,r in qs:
    d = l%D
    print(cums[d][r//D] - cums[d][l//D])
inputs=list(map(int, input().split()))
print(f"{inputs[2] - min(inputs[0]-inputs[1], inputs[2])}")


### FIXED CODE ###

inputs=list(map(int, input().split()))
ans = inputs[2] - min(inputs[0]-inputs[1], inputs[2])
print("{}".format(ans))
n=int(input())
if k%1000!=0:print((k+1)*1000-n)
else:print(0)


### FIXED CODE ###

n=int(input())
k=n//1000
if n%1000!=0:print((k+1)*1000-n)
else:print(0)
n = int(input())
arr = list(map(int, input().split()))
if 0 in arr: print(0)
else:
	prod = 1
	for i in arr:
		count *= i
	if count > 1000000000000000000: count = -1
	print(count)

### FIXED CODE ###

n = int(input())
arr = input().split()


def mult():
    if "0" in arr:
        return 0
    else:
        a = 1
        for i in arr:
            a = a * int(i)
            if a > 1000000000000000000:
                return -1
        return a

print(mult())
n=int(input())
l=list(map(int,input().split()))
ones,twos,threes=0,0,0
for i in l:
    if i==1:
        ones+=1
    elif i==2:
        twos+=2
    else:
        threes+=3
max_ones=ones+twos+threes
max_twos=twos+threes
max_threes=threes
dp=[[[0.0]*(n+1)for i in range(n+1)]for j in range(n+1)]
for k in range(max_threes+1):
    for j in range(max_twos+1-k):
        for i in range(max_ones+1-j-k):
            if i+j+k==0:
                continue
            else:
                dp[i][j][k]=n/(i+j+k)
                if i>0:
                    dp[i][j][k]+=(dp[i-1][j][k]*i)/(i+j+k)
                if j>0:
                    dp[i][j][k]+=(dp[i+1][j-1][k]*j)/(i+j+k)
                if k>0:
                    dp[i][j][k]+=(dp[i][j+1][k-1]*k)/(i+j+k)
print(dp[i][j][k])




            

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
ones,twos,threes=0,0,0
for i in l:
    if i==1:
        ones+=1
    elif i==2:
        twos+=1
    else:
        threes+=1
max_ones=ones+twos+threes
max_twos=twos+threes
max_threes=threes
dp=[[[0.0]*(n+1)for i in range(n+1)]for j in range(n+1)]
for k in range(max_threes+1):
    for j in range(max_twos+1-k):
        for i in range(max_ones+1-j-k):
            if (i+j+k)==0:
                continue
            else:
                dp[i][j][k]=n/(i+j+k)
                if i>0:
                    dp[i][j][k]+=(dp[i-1][j][k]*i)/(i+j+k)
                if j>0:
                    dp[i][j][k]+=(dp[i+1][j-1][k]*j)/(i+j+k)
                if k>0:
                    dp[i][j][k]+=(dp[i][j+1][k-1]*k)/(i+j+k)
print(dp[i][j][k])
h, w = map(int, input().split())
s = []
s_conn = []
for i in range(h):
  s.append(input())
  s_conn.append([[0]*2 for j in range(w)])

# 縦にみる
for x in range(w):
  start = 0
  count = 0
  for y in range(h):
    if s[y][x] = '.':
      count += 1
      if y == h-1:
        for i in range(start, y):
          s_conn[i][x][0] = count
    else:
      for i in range(start, y):
        s_conn[i][x][0] = count
      count = 0
      start = y+1

# 横にみる
for y in range(h):
  start = 0
  count = 0
  for x in range(w):
    if s[y][x] = '.':
      count += 1
      if x == w-1:
        for i in range(start, x):
          s_conn[y][i][0] = count
    else:
      for i in range(start, x):
        s_conn[y][i][0] = count
      count = 0
      start = x+1

print(max(map(sum, s_conn)) - 1)

### FIXED CODE ###

h, w = map(int, input().split())
s = []
l = []
r = []
u = []
d = []
for i in range(h):
  s.append(input())
  l.append([0 for j in range(w)])
  r.append([0 for j in range(w)])
  u.append([0 for j in range(w)])
  d.append([0 for j in range(w)])
  
# lみる
for x in range(w):
  for y in range(h):
    if s[y][x] == '.':
      if x == 0:
        l[y][x] = 1
      else:
        l[y][x] = l[y][x-1] + 1
 
# rみる
for x in range(w-1, -1, -1):
  for y in range(h-1, -1, -1):
    if s[y][x] == '.':
      if x == w-1:
        r[y][x] = 1
      else:
        r[y][x] = r[y][x+1] + 1
 
# uみる
for y in range(h):
  for x in range(w):
    if s[y][x] == '.':
      if y == 0:
        u[y][x] = 1
      else:
        u[y][x] = u[y-1][x] + 1
 
# dみる
for y in range(h-1, -1, -1):
  for x in range(w-1, -1, -1):
    if s[y][x] == '.':
      if y == h-1:
        d[y][x] = 1
      else:
        d[y][x] = d[y+1][x] + 1
 
 
max_all = 0
for y in range(h):
  for x in range(w):
    max_tmp = l[y][x] + r[y][x] + u[y][x] + d[y][x]
    if max_tmp > max_all:
      max_all = max_tmp
      
print(max_all - 3)
INF=10**10
def main():
  H,N=map(int,input().split())
  AB=[]
  for i in range(N):
    AB.append(list(map(int,input().split())))
  dp=[INF]*(H+1)
  dp[0]=0
  for a,b in AB:
    for k in range(H+1):
      tmp=k-a
      if tmp<0:
        tmp=0
      need_magic=dp[tmp]+b
      if need_magic<dp[k]:
        dp[k]=need_magic
  print(dp[H+1])
main()
      

### FIXED CODE ###

INF=10**10
def main():
  H,N=map(int,input().split())
  AB=[]
  for i in range(N):
    AB.append(list(map(int,input().split())))
  dp=[INF]*(H+1)
  dp[0]=0
  for a,b in AB:
    for k in range(H+1):
      tmp=k-a
      if tmp<0:
        tmp=0
      need_magic=dp[tmp]+b
      if need_magic<dp[k]:
        dp[k]=need_magic
  print(dp[H])
main()
sec = int(input())
print(sec//3600, ':', (sec//3600)%60, ':', sec%60, sep' ')


### FIXED CODE ###

sec = int(input())
print(sec//3600, ':', (sec%3600)//60, ':', sec%60, sep='')
# -*- coding: utf-8 -*-
r,g,b = int(input())
S = "r"+"g"+"b"
T = int(input(S))
if T % 4 == 0:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

# -*- coding: utf-8 -*-
r,g,b =map(str, input().split())
S = r+g+b
T = int(S)
if T % 4 == 0:
  print("YES")
else:
  print("NO")
n = int(input())
v = list(map(int, input().split()))
v1 = []
v2 = []
ans = 0

for i in range(n):
    if i % 2 == 0:
        v1.append(v[i])
    else:
        v2.append(v[i])

mostCount1 = 0
mostChar1 = 0
dp1 = [None] * 10000

for i in range(n//2):
    count = 0
    if dp1[v1[i]] is not None:
        count = dp1[v1[i]]
    else:
        dp1[v1[i]] = v1.count(v1[i])
        count = dp1[v1[i]]
#    count = v1.count(v1[i])
    if count > mostCount1:
        mostCount1 = count
        mostChar1 = v1[i]
        if mostCount1 > n//2:
            break

mostCount2 = 0
mostChar2 = 0
dp2 = [None] * 10000

for i in range(n//2):
#    count = v2.count(v2[i])
    count = 0
    if dp2[v2[i]] is not None:
        count = dp2[v2[i]]
    else:
        dp2[v2[i]] = v2.count(v2[i])
        count = dp2[v2[i]]

    if count > mostCount2:
        mostCount2 = count
        mostChar2 = v2[i]
        if mostCount2 > n//2:
            break

if mostChar1 == mostChar2:
    ans = n//2
else:
    ans = n - mostCount1 - mostCount2

print(ans)

### FIXED CODE ###

import collections

n = int(input())
v = list(map(int, input().split()))
v1 = []
v2 = []
ans = 0

for i in range(n):
    if i % 2 == 0:
        v1.append(v[i])
    else:
        v2.append(v[i])

c1 = collections.Counter(v1)
mostChar1, mostCount1 = c1.most_common()[0]
#ndChar1, ndCount1 = c1.most_common()[1]

c2 = collections.Counter(v2)
mostChar2, mostCount2 = c2.most_common()[0]
#ndChar2, ndCount2 = c2.most_common()[1]

if mostChar1 == mostChar2:
    if len(c1.most_common()) == 1 and len(c1.most_common()) == 1:
        ans = n // 2
    elif len(c1.most_common()) == 1:
        ndChar2, ndCount2 = c2.most_common()[1]
        ans = n - mostCount1 - ndCount2
    elif len(c2.most_common()) == 1:
        ndChar1, ndCount1 = c1.most_common()[1]
        ans = n - mostCount2 - ndCount1
    else:
        ndChar1, ndCount1 = c1.most_common()[1]
        ndChar2, ndCount2 = c2.most_common()[1]
        temp1 = n - mostCount1 - ndCount2
        temp2 = n - mostCount2 - ndCount1
        ans = min(temp1, temp2)
else:
    ans = n - mostCount1 - mostCount2

print(ans)
(A, V) = input().split()
(B, W) = input().split()
T = input()

D = abs(A - B)
X = abs(x - Y)

if (X*T >= D):
  print("OK")
else:
  print("NG")


### FIXED CODE ###

(A, V) = map(lambda a: float(a), input().split())
(B, W) = map(lambda a: float(a), input().split())
T = float(input())

D = abs(A - B)
X = V - W

if (X*T >= D):
  print("YES")
else:
  print("NO")
x,y=map(int,input().split())
d=x//y
r=x%y
f=x/y
print(f"{d} {r} {.5f}")



### FIXED CODE ###

x,y=map(int,input().split())
print("{0} {1} {2:.8f}".format(x//y,x%y,x/y))
# https://atcoder.jp/contests/keyence2019/tasks/keyence2019_b

import re

S = input()

if "keyence" == S:
    print("YES")
else:
    patterns = ["^keyence*", "^k*eyence$", "^ke*yence$", "^key*ence$", "^keye*nce$", "^keyen*ce$", "^keyenc*e$", "*keyence$"]

    matched = False
    for pattern in patterns:
        matchOB = re.search(pattern, S)
        if matchOB:
            matched = True
            break
    if matched:
        print("YES")
    else:
        print("NO")




### FIXED CODE ###

# https://atcoder.jp/contests/keyence2019/tasks/keyence2019_b

import re

S = input()

if "keyence" == S:
    print("YES")
else:
    patterns = ["^keyence(.*)", "^k(.*)eyence$", "^ke(.*)yence$", "^key(.*)ence$", "^keye(.*)nce$", "^keyen(.*)ce$", "^keyenc(.*)e$", "keyence$"]

    matched = False
    for pattern in patterns:
        matchOB = re.search(pattern, S)
        if matchOB:
            matched = True
            break
    if matched:
        print("YES")
    else:
        print("NO")
O = input()
E = input()
res = ''
for i in range(len(O)):
    res += O[i] + E[i]
if len(O)>len(E):
    res += O[-1]
print(res)

### FIXED CODE ###

O = input()
E = input()
res = ''
for i in range(len(E)):
    res += O[i] + E[i]
if len(O)>len(E):
    res += O[-1]
print(res)
# -*- coding: utf-8 -*-
import fractions

N = int(input().rstrip())
As = list(map(int, input().rstrip().split()))


def gcd_list(numbers):
    res = fractions.gcd(numbers[0], numbers[1])
    if len(numbers) > 2:
        for idx in range(2, len(numbers)):
            res = fractions.gcd(res, numbers[idx])
    return res


max_gcd = 0
if(N) == 2:
    max_gcd = max(As)
else:
    for i in range(N):
        others = [As[j] for j in range(N) if j != i]
        max_gcd = max(gcd_list(others), max_gcd)

print(max_gcd)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np
A, B, T = map(int, input().split())

x = int(np.floor((T + 0.5) / A))

print(x * B)
n, m, X, Y = map(int, input().split())
x = map(int, input().split())
y = map(int, input().split())

if(max(x, X) < min(y, Y)):
    print("No War")
else:
    print("War")

### FIXED CODE ###

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

if(max(max(x), X) < min(min(y), Y)):
    print("No War")
else:
    print("War")
n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort()

if 1 == len(l):
    if l[0] >= k:
        print(1)
    else:
        print(0)
    exit()
        
suffix = n // 2
if l[suffix] <= k:
    for i in range(suffix, n+1):
        if l[i] >= k:
            min_suffix = i
            print(n - min_suffix)
            exit()
else:
    for i in range(suffix):
        if l[i] >= k:
            min_suffix = i
            print(n - min_suffix)
            exit()
            
print(0)

### FIXED CODE ###

n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
   
for i in range(n):
    if l[i] >= k:
        print(n-i)
        exit()
print(0)
from math import ceil
N, K = map(int, raw_input().split())
A = map(int, raw_input().split())

print (ceil(N - 1 // K - 1))

### FIXED CODE ###

import math
N, K = map(int, input().split())
input()
     
print(math.ceil((N-1)/(K-1)))
import math
a,b,x = map(float,input().split())

c = a/(2*b-(2*x)/(a*a))
d = (2*x)/(a*b*b)
if x/a >= a*b/2:
  result = math.degrees(math.atan(c))
else:
  result = math.degrees(math.atan(d))
print(result)

### FIXED CODE ###

import math
a,b,x = map(float,input().split())

c = (2*b-(2*x)/(a*a))/a
d = (a*b*b)/(2*x)
if x/a >= a*b/2:
  result = math.degrees(math.atan(c))
else:
  result = math.degrees(math.atan(d))
print(result)
#!python
# -*- coding: utf-8 -*-

import sys

sys.setswitchinterval(10**8)


next_s = ((-1, 1), (0, 1), (1, 1),
          (-1, 0), (1, 0),
          (-1, -1), (0, -1), (1, -1))


def DFS(x, y):
    if not (0 <= x < W and 0 <= y < H):
        return
    if not map_[y * W + x]:
        return

    map_[y * W + x] = 0

    for dx, dy in next_s:
        DFS(x + dx, y + dy)


while True:
    W, H = map(int, input().split())
    if W == 0 and H == 0:
        break

    map_ = []
    for h in range(H):
        map_ += list(map(int, input().split()))
    # print(map_)
    island_num = 0
    while any(map_):
        next_idx = map_.index(1)
        x = next_idx % W
        y = next_idx // W
        # print(map_)
        # print("x: {} | y: {}".format(x, y))
        DFS(x, y)
        island_num += 1

    print(island_num)



### FIXED CODE ###

#!python
# -*- coding: utf-8 -*-

import sys

sys.setrecursionlimit(10**6)


next_s = ((-1, 1), (0, 1), (1, 1),
          (-1, 0), (1, 0),
          (-1, -1), (0, -1), (1, -1))


def DFS(x, y):
    if not (0 <= x < W and 0 <= y < H):
        return
    if map_[y][x] == 0:
        return

    map_[y][x] = 0

    for dx, dy in next_s:
        DFS(x + dx, y + dy)


while True:
    W, H = map(int, input().split())
    if W == 0 and H == 0:
        break
    map_ = [list(map(int, input().split())) for h in range(H)]
    island_num = 0
    for x in range(W):
        for y in range(H):
            if map_[y][x] == 1:
                DFS(x, y)
                island_num += 1
    print(island_num)
#from fractions import gcd
from math import gcd

def lcm(m, n): return m * n // gcd(m, n)

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

MOD = 10 ** 9 + 7

mulab = 1
for i in range(n):
    mulab = lcm(mulab, a[i])

mulab %= MOD
ans = 0
for i in range(n):
    #フェルマーの小定理
    ans = ans + mulab * pow(a[i], MOD-2, MOD)
    ans %= MOD

print(ans)

### FIXED CODE ###

from fractions import gcd
#from math import gcd
 
def lcm(m, n): return m * n // gcd(m, n)
 
n = int(input())
a = list(map(int, input().split()))
 
MOD = 10 ** 9 + 7
 
mulab = 1
for i in range(n):
    mulab = lcm(mulab, a[i])
 
mulab %= MOD
ans = 0
for i in range(n):
    #フェルマーの小定理
    ans = ans + mulab * pow(a[i], MOD-2, MOD)
    ans %= MOD
 
print(ans)
using namespace std;
 
int main() {
    int N, A, B, C, D;
    string S;
    cin >> N >> A >> B >> C >> D >> S;
    
    S = "#" + S + "#";
 
    auto can_reach = [&](int start, int end) {
        for (int i = start; i + 1 <= end; i++) {
            if (S[i] == '#' && S[i + 1] == '#') return false;
        }

### FIXED CODE ###

N,A,B,C,D = map(int,input().split())
S = str(input())
ans = "Yes"

S0 = S[:A]
Sa = S[A-1:C]
Sb = S[B-2:D+1]
F = max(C,D)
S1 = S[F:]
#if S0.rfind('##')>=0 and S1.find('##')>=0 :
#    Sfe = S[S0.rfind('##'):(F+S1.find('##'))]
#elif S0.rfind('##')>=0 :
#    Sfe = S[S0.rfind('##'):]
#elif S1.find('##')>=0 :
#    Sfe = S[:(F+S1.find('##'))]
#else :
#    Sfe = S


#if S.find('##')>=0 and A<S.find('ABC')<C or B<S.find('ABC')<D:
if Sa.find('##')>=0 or Sb.find('##')>=0:
    ans = "No"

if A<B<D<C and not '...' in Sb:
    ans = "No"

print(ans)