Harryxun/stf_run huggingface dataset:
#CGL_4-A Convex Polygon - Convex Hull
from collections import deque

def isCLKWISE(ph):
    a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
    b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
    crs = a[0]*b[1] - a[1]*b[0]
    if crs < 0 :
        return False
    else :
        return True
    
def ConvexHullScan(P):
    P = sorted(P)
    phU = deque([])
    phU.append(P[0])
    phU.append(P[1])
    for p in P[2:]:
        phU.append(p)
        while(True):
            if isCLKWISE(phU) :
                break
            else :
                del phU[-2]
                if len(phU) == 2 :
                    break
    phL = deque([])
    phL.append(P[-1])
    phL.append(P[-2])
    for p in P[-3::-1]:
        phL.append(p)
        while(True):
            if isCLKWISE(phL) :
                break
            else :
                del phL[-2]
                if len(phL) == 2 :
                    break
    phL.pop()
    phL.popleft()
    ph = phU + phL
    return ph

n = int(input())
P = deque([])
for i in range(n):
    P.append([int(x) for x in input().split()])
Q = ConvexHullScan(P)
print(len(Q))
Q.reverse()
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(Q)])[2]
Q.rotate(-idx)
for q in Q:
    print(q[0],q[1])

### FIXED CODE ###

def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
      
def ConvexHullScan(P):
    P = sorted(P)
    phU = [P[0],P[1]]
    for p in P[2:]:
        phU.append(p)
        while(True):
            try :
                if isCLKWISE(phU) : break
                else : del phU[-2]
            except IndexError : break
    phL = [P[-1],P[-2]]
    for p in P[-3::-1]:
        phL.append(p)
        while(True):
            try :
                if isCLKWISE(phL) : break
                else : del phL[-2]
            except IndexError : break
    ph = phU + phL[1:-1]
    return ph
  
P = [[int(x) for x in input().split()] for _ in range(int(input()))]
P = ConvexHullScan(P)
P.reverse()
print(len(P))
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(P)])[2]
for p in P[idx:] + P[:idx] : print(p[0],p[1])
n,m = map(int,input().split())
G = [[] for _ in range(n)]
INF = float("INF")
pos = [INF]*n
for _ in range(m):
    l,r,d = map(int,input().split())
    l -= 1
    r -= 1
    G[l].append((r,d))
    G[r].append((l,-d))

def dfs(now):
    for nxt,d in G[now]:
        if pos[nxt] == INF:
            pos[nxt] = pos[now]+d
            dfs(nxt)
        elif pos[nxt] != pos[now]+d:
            print("No")
            exit()

for i in range(n):
    if pos[i] == INF:
        pos[i] = 0
        dfs(i)
print("Yes")

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)

n,m = map(int,input().split())
G = [[] for _ in range(n)]
INF = float("INF")
pos = [INF]*n
for _ in range(m):
    l,r,d = map(int,input().split())
    l -= 1
    r -= 1
    G[l].append((r,d))
    G[r].append((l,-d))

def dfs(now):
    for nxt,d in G[now]:
        if pos[nxt] == INF:
            pos[nxt] = pos[now]+d
            dfs(nxt)
        elif pos[nxt] != pos[now]+d:
            print("No")
            exit()

for i in range(n):
    if pos[i] == INF:
        pos[i] = 0
        dfs(i)
print("Yes")
from scipy.special import comb
n,m = map(int,(input().split()))
bulb = [0]*m
p = [0]*m
j = 1
odd = 0
even = 0
for i in range(m):
    bulb[i] = list(map(int,input().split()))
p = list(map(int,input().split()))
 
for i in range(m):
    if not bulb[i][0]%2==p[i]:
        print(0)
        exit()
    elif bulb[i][0]%2==0:
        for j in range(0,bulb[i][0]+1,2):
            even = even + comb(bulb[i][0],j, exact=True)
            
        if len(bulb[i])==2:
            even = even/2
            
    else:
        for j in range(1,bulb[i][0]+1,2):
            odd = odd + comb(bulb[i][0],j, exact=True)
          
        if len(bulb[i])==2:
            odd = odd/2              
 
print(int(odd*even))

### FIXED CODE ###

n,m = map(int,input().split())
res = 0

q = []
for i in range(m):
    q.append(list(map(int,input().split())))
p = list(map(int,input().split()))

for s in range(2**n):
    judge = True
    for i in range(m):
        cnt = 0
        for j in range(1,len(q[i])):
            w = q[i][j]
            if s>>(w-1) &1 == 1:
                cnt += 1
        if cnt % 2 != p[i]:
            judge = False
    if judge:
        res += 1
print(res)
import heapq

if __name__ == "__main__":
    K,T = map(int, input().split())
    data = list(map(int, input().split()))
    data.sort()
    cake = []
    for i,x in enumerate(data):
        cake.append([x, i])
    heapq._heapify_max(cake)
    while (len(cake) > 1):
        p = heapq._heappop_max(cake)
        q = heapq._heappop_max(cake)
        p[0] -= 1
        q[0] -= 1
        if p[0] > 0:
            heapq.heappush(cake, p)
        if q[0] > 0:
            heapq.heappush(cake, q)
    result = 0
    if len(cake) > 0:
        result = cake[0][0]
    print (max(0, result - 1))


### FIXED CODE ###

import heapq

if __name__ == "__main__":
    K,T = map(int, input().split())
    data = list(map(int, input().split()))
    cake = []
    for i,x in enumerate(data):
        cake.append([x, i])
    heapq._heapify_max(cake)
    while (len(cake) > 1):
        heapq._heapify_max(cake)
        p = heapq.heappop(cake)
        q = heapq.heappop(cake)
        # print (p,q)
        p[0] -= 1
        q[0] -= 1
        if p[0] > 0:
            heapq.heappush(cake, p)
        if q[0] > 0:
            heapq.heappush(cake, q)
    result = 0
    if len(cake) > 0:
        t = heapq.heappop(cake)
        result = t[0]
    print (max(0, result - 1))
SIZE=4*10**5+1; MOD=10**9+7 #998244353 #ここを変更する
 
SIZE += 1
inv = [0]*SIZE  # inv[j] = j^{-1} mod MOD
fac = [0]*SIZE  # fac[j] = j! mod MOD
finv = [0]*SIZE # finv[j] = (j!)^{-1} mod MOD
inv[1] = 1
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
for i in range(2,SIZE):
    inv[i] = MOD - (MOD//i)*inv[MOD%i]%MOD
    fac[i] = fac[i-1]*i%MOD
    finv[i]= finv[i-1]*inv[i]%MOD
 
def choose(n,r): # nCr mod MOD の計算
    if 0 <= r <= n:
        return (fac[n]*finv[r]%MOD)*finv[n-r]%MOD
    else:
        return 0
 
def chofuku(n,r): # nHr mod MOD の計算
    return choose(n+r-1,r)

def narabekae(n,r): #nPr mod MOD の計算
    return fac[n]*finv[n-r]%MOD


N,M=map(int,input().split())
ans=0
for k in range(N+1):
    ans+=choose(N,k)*narabekae(M-k,N-k)*((-1)**k)
    ans%=MOD
ans*=narabekae(M,N)

print(ans%MOD)


### FIXED CODE ###

SIZE=5*10**5+1; MOD=10**9+7 #998244353 #ここを変更する
 
SIZE += 1
inv = [0]*SIZE  # inv[j] = j^{-1} mod MOD
fac = [0]*SIZE  # fac[j] = j! mod MOD
finv = [0]*SIZE # finv[j] = (j!)^{-1} mod MOD
inv[1] = 1
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
for i in range(2,SIZE):
    inv[i] = MOD - (MOD//i)*inv[MOD%i]%MOD
    fac[i] = fac[i-1]*i%MOD
    finv[i]= finv[i-1]*inv[i]%MOD
 
def choose(n,r): # nCr mod MOD の計算
    if 0 <= r <= n:
        return (fac[n]*finv[r]%MOD)*finv[n-r]%MOD
    else:
        return 0
 
def chofuku(n,r): # nHr mod MOD の計算
    return choose(n+r-1,r)

def narabekae(n,r): #nPr mod MOD の計算
    return fac[n]*finv[n-r]%MOD


N,M=map(int,input().split())
ans=0
for k in range(N+1):
    ans+=choose(N,k)*narabekae(M-k,N-k)*(-1 if k%2==1 else 1)
    ans%=MOD
ans*=narabekae(M,N)
print(ans%MOD)
# N A B C
# l1
# l2
# ...

(N, A, B, C) = int(input().split())
L = []
for i in range(N):
    l = int(input())
    L.append(l)
# N = 5
# A = 100
# B = 90
# C = 80
# L = [98, 40, 30, 21, 80]

def recur_function(a, b, c, n):
    if n == N:
        return abs(a - A) + abs(b - B) + abs(c - C) if min(a, b, c) > 0 else 10**9
    ret0 = recur_function(a + L[n], b, c, n + 1) + 10 if a > 0 else recur_function(a + L[n], b, c, n + 1)
    ret1 = recur_function(a, b + L[n], c, n + 1) + 10 if b > 0 else recur_function(a, b + L[n], c, n + 1)
    ret2 = recur_function(a, b, c + L[n], n + 1) + 10 if c > 0 else recur_function(a, b, c + L[n], n + 1)
    ret3 = recur_function(a, b, c, n + 1)
    return min(ret0, ret1, ret2, ret3)

print(recur_function(0, 0, 0, 0))

### FIXED CODE ###

# N A B C
# l1
# l2
# ...

tmp = input().split()
(N, A, B, C) = (int(tmp[i]) for i in range(4))
L = []
for i in range(N):
    l = int(input())
    L.append(l)
# N = 5
# A = 100
# B = 90
# C = 80
# L = [98, 40, 30, 21, 80]

def recur_function(a, b, c, n):
    if n == N:
        return abs(a - A) + abs(b - B) + abs(c - C) if min(a, b, c) > 0 else 10**9
    ret0 = recur_function(a + L[n], b, c, n + 1) + 10 if a > 0 else recur_function(a + L[n], b, c, n + 1)
    ret1 = recur_function(a, b + L[n], c, n + 1) + 10 if b > 0 else recur_function(a, b + L[n], c, n + 1)
    ret2 = recur_function(a, b, c + L[n], n + 1) + 10 if c > 0 else recur_function(a, b, c + L[n], n + 1)
    ret3 = recur_function(a, b, c, n + 1)
    return min(ret0, ret1, ret2, ret3)

print(recur_function(0, 0, 0, 0))
import sys
 
def input():
    return sys.stdin.readline().strip()
 
n = int(input())
A = list(map(int, input().split()))
sum = 1
for i in range(n):
    sum *= A[i]
if(sum > 10**18):
    sum = -1
print(sum)

main()

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline().strip()

def main():
    n = int(input())
    A = list(map(int, input().split()))
    if 0 in A:
        print(0)
        return
    x = 1
    for i in A:
        x *= i
        if x > pow(10,18):
            print(-1)
            return
    print(x)

main()
import math

i = list(map(int,input().split()))
A = i[0]
B = i[1]

ans = (A * B) // math.gcd(A, B)

print(ans)

### FIXED CODE ###

from fractions import gcd

i = list(map(int,input().split()))
A = i[0]
B = i[1]

ans = (A * B) // gcd(A, B)

print(ans)
a,b=list(map(int,input().split()))

import math

res=a*b/math.gcd(a,b)
print(int(res))



### FIXED CODE ###


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

from fractions import gcd

res=a*b/gcd(a,b)
print(int(res))
def main():
	N, K = map(int, input().split())
	DIV = 10**9+7
	ab = [[] for _ in range(N)]

	size = max(N+1, K+1)
	fact = [0]*size
	inverse = [0]*size
	inv_cal = [0]*size
	fact[:2] = [1, 1]
	inverse[:2] = [1, 1]
	inv_cal[:2] = [0, 1]

	for i in range(2, size):
		fact[i] = (fact[i-1]*i%DIV)
		inv_cal[i] = (-inv_cal[DIV%i]*(DIV//i))%DIV
		inverse[i] = inverse[i-1]*inv_cal[i]%DIV

	def C(n, r):
		ans = fact[n]*inverse[r]%DIV
		return ans*inverse[n-r]%DIV

	def P(n, r):
		if n < 0:
			return 0
		ans = C(n, r)
		return ans*fact[r]%DIV

	for _ in range(N-1):
		u, v = map(int, input().split())
		ab[u-1].append(v-1)
		ab[v-1].append(u-1)

	def dfs(v, ans=1, p=-1):
		for u in ab[v]:
			if u == p:
				continue
			ans = dfs(u, ans, v)
		c = 0
		nk = K
		if p == -1:
			c = len(ab[v])+1
		else:
			c = len(ab[v])-1
			nk = K-2
		ans *= P(nk, c)
		return ans%DIV
	ans = dfs(0)
	print(ans)


if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def main():
	N, K = map(int, input().split())
	DIV = 10**9+7
	ab = [[] for _ in range(N)]

	def P(n, r):
		ans = 1
		for i in range(r):
			ans = (ans*(n-i)) % DIV
		return ans

	for _ in range(N-1):
		u, v = map(int, input().split())
		ab[u-1].append(v-1)
		ab[v-1].append(u-1)

	def dfs(v, p=-1):
		c = 0
		ans = 1
		for u in ab[v]:
			if u == p:
				continue
			c += 1
			ans = ans * dfs(u, v) % DIV
		nk = K-1
		if p != -1:
			nk = K-2
		ans *= P(nk, c)
		return ans%DIV
	ans = dfs(0)*K%DIV
	print(ans)


if __name__ == '__main__':
	main()
n,k=map(int,input().split())
a = list(map(int,input().split()))
minus = [a[i] for i in range(n) if a[i] < 0][::-1]

plus = [a[i] for i in range(n) if a[i] > 0]

min_ = 10**18

for i in range(min(k, len(plus))):
  min_ = min(2*plus[i]+minus[k-2-i], plus[i]+2*minus[k-2-i])
print(min_)
  

### FIXED CODE ###

n,k=map(int,input().split())
a = list(map(int,input().split()))
minus = [0]+[abs(a[i]) for i in range(n) if a[i] < 0][::-1]

plus = [0]+[a[i] for i in range(n) if a[i] >= 0]

min_ = 10**18

if len(plus) == 1:
  print(minus[k])
elif len(minus) == 1:
  print(plus[k])
else:
  for i in range(min(k+1, len(plus))):
    if k-i < len(minus):
      min_ = min(min_, 2*plus[i]+minus[k-i], plus[i]+2*minus[k-i])
  print(min_)
N = int(input())
S = input()
  
co = 0
index =0
n =[]
str = ""

for i in range(N):
  index=str.find(S[i])
  if index == -1 :
    str += S[i]
    n.append(2)
  else :
    n[i] += 1

co = 1
for i in range(len(n)):
  co = co * n[i]
co -= 1

print(co % 1000000007)

### FIXED CODE ###

N = int(input())
S = input()
  
co = 0
index =0
n =[]
str = ""

for i in range(N):
  index=str.find(S[i])
  if index == -1 :
    str += S[i]
    n.append(2)
  else :
    n[index] += 1

co = 1
for i in range(len(n)):
  co = co * n[i]
co -= 1

print(co % 1000000007)
N = int(iput())
X = list(map(int,input().split()))
Ans = 0
M = Rn (sum(X)/N)
for i in X:
  Ans +=(i-M)**2
print(Ans)

### FIXED CODE ###

N = int(input())
X = list(map(int,input().split()))
Ans = 0
M = round(sum(X)/N)
for i in X:
    Ans +=(i-M)**2
print(Ans)
S = input()
K = input()

if S[0] != "1":
    print(S[0])
else:
    if S[1] != "1":
        print(S[1])
    else:
        if S[2] != "1":
            print(S[2])
        else:
            if S[3] != "1":
                print(S[3])
            else:
                print(1)




### FIXED CODE ###

S = input()
K = input()

for i in range(int(K)):
    if S[i] != "1":
        print(S[i])
        break
else:
    print(1)
s=input()
if s[2]=s[3] and s[4]=s[5]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = input()
if s[2] == s[3] and s[4] == s[5]:
  print("Yes")
else:
  print("No")
c=(a*b)%2
if c=1:
    print('Odd')
else: print('even')

### FIXED CODE ###

a, b = map(int, input().split())
if a*b % 2 == 1:
    print("Odd")
else:
    print("Even")
n,m,d=map(float,input().split())
print((m-1)*(n-d)*((d)?2:1)/(n*n));

### FIXED CODE ###

n,m,d=map(float,input().split())
print((m-1)*(n-d)*([1,2][d>0])/n**2);
N=int(input())
def yakusuu(n):
  num=0
  for i in range(1,n):
    if n%i==0:
      num=num+1
  return num==8
ans=0
for i in range(n):
  if def(i):
    ans=ans+1
print(ans)
  
      

### FIXED CODE ###

n=int(input())
def yakusuu(n):
  num=0
  if n%2==1:
    for i in range(1,n+1):
      if n%i==0:
        num=num+1
  return num 

ans=0
for i in range(n+1):
  if yakusuu(i)==8:
    ans=ans+1
print(ans)
N,M = map(int, input().split())
def abc(n, m):
    if n<=abs(n-m):
        return n
    else:
        return abc(abs(n-m), m)
print(abc(N,M))

### FIXED CODE ###

N,M = map(int, input().split())
if N>=N%M:
    if N%M>=M-N%M:
        ans=M-N%M
    else:
        ans=N%M
else:
    ans=N
print(ans)
s=input()
l=""
for i in s:
  if i=="B":
    if len(l)!=0:
      l.rstrip()
  elif i=="0":
    l.append(i)
  elif i=="1":
    l.append(i)
print(l)

### FIXED CODE ###

s=list(input())
l=[]
for i in s:
    if i=="1":
        l.append(i)
    elif i=="0":
        l.append(i)
    elif i=="B":
        if len(l)!=0:
            l.pop()
print("".join(l))
import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,K = [int(i) for i in input().split()]
for i in range(1,K+1):
    print((combinations_count(N-K+1,i)*combinations_count(K-1,i-1))%(10**9+7))


### FIXED CODE ###

import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,K = [int(i) for i in input().split()]
for i in range(1,K+1):
    if (N-K+1)<i:
        print(0)
        continue
    print((combinations_count(N-K+1,i)*combinations_count(K-1,i-1))%(10**9+7))
# -*- coding: utf-8 -*-
from collections import defaultdict
from heapq import heappop, heappush


class Graph(object):
    """
    隣接リストによる有向グラフ
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst, weight=1):
        self.graph[src].append((dst, weight))

    def get_nodes(self):
        return self.graph.keys()


class Dijkstra(object):
    """
    ダイクストラ法（二分ヒープ）による最短経路探索
    計算量: O((E+V)logV)
    """

    def __init__(self, graph, start):
        self.g = graph.graph

        # startノードからの最短距離
        # startノードは0, それ以外は無限大で初期化
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[start] = 0

        # 最短経路での1つ前のノード
        self.prev = defaultdict(lambda: None)

        # startノードをキューに入れる
        self.Q = []
        heappush(self.Q, (self.dist[start], start))

        while self.Q:
            # 優先度（距離）が最小であるキューを取り出す
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, weight in self.g[u]:
                alt = dist_u + weight
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    self.prev[v] = u
                    heappush(self.Q, (alt, v))

    def shortest_distance(self, goal):
        """
        startノードからgoalノードまでの最短距離
        """
        return self.dist[goal]

    def shortest_path(self, goal):
        """
        startノードからgoalノードまでの最短経路
        """
        path = []
        node = goal
        while node is not None:
            path.append(node)
            node = self.prev[node]
        return path[::-1]


def query(src, dst, d_list, d_dict, l):
    count = 0
    now_l = l
    d = d_list[src-1]
    distance = d.shortest_distance(dst-1)
    if distance <= l:
        print(0)
        return

    path = d.shortest_path(dst-1)

    if(len(path) == 1):
        print(-1)
        return

    now_s = path[0]

    for item in path[1:]:
        length = d_dict[str(now_s)+":"+str(item)]
        if length > l:
            print(-1)
            return
        elif length > now_l:
            count += 1
            now_l = l - length
        else:
            now_l = now_l - length
        now_s = item
    print(count)


n, m, l = map(int, input().split())
inputs = []
d_dict = dict()

for i in range(m):
    a, b, c = map(int, input().split())
    inputs.append((a-1, b-1, c))
    d_dict[str(a-1)+":"+str(b-1)] = c
    d_dict[str(b-1)+":"+str(a-1)] = c

g = Graph()
for src, dst, weight in inputs:
    g.add_edge(src, dst, weight)
    g.add_edge(dst, src, weight)

d_list = []

for i in range(n):
    d_list.append(Dijkstra(g, i))

q = int(input())

for i in range(q):
    s, t = map(int, input().split())
    query(s, t, d_list, d_dict, l)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, input().split())

print(max(0, a - 2 * b))
value = input()
list = value.split()
A = int(list[2] - list[0])
print(int(list[1]) - A)

### FIXED CODE ###

a,b,k = map(int,input().split())
if a - k >= 0 :
    print(a - k,b)
elif a + b - k >= 0  :
    print(0,b-(k-a))
else:
    print(0,0)
L,N=(int(i) for i in input().split())
n = int(input())
X = [0 for i in range(0,N)]
for i in range(0,N):
    X[i] = int(input())
a=0
if X[2/L.ceil()]<L/2:
  for i in range (1,L/2):
    for j in range (N,L/2,-1):
      a+=abs(X[j]-X[i])
else:
   for i in range (1,L/2):
    for j in range (N,L/2,-1):
      a+=abs(X[i]-X[j])
print(a)

### FIXED CODE ###

a,b,c=(int(i) for i in input().split())
if b+1>=c:
  print(b+c)
else:
  if a+1>=c-b:
    print(b+c)
  else:
    print(2*b+a+1)
import numpy as np
def main():
  ttt = []
  n = int(input())
  e = [[int(i) for i in input().split()] for i in range(int(input()))]
  for i in range(n):
    t = e[0][0] - e[1][i]*0.006
 	tt = abs(e[0][1] - t)
    ttt.append(tt)
  print(np.argmin(ttt)+1)
main()

### FIXED CODE ###

import numpy as np
def main():
    ttt = []
    n = int(input())
    N, M = map(int, input().split())
    e = list(map(int, input().split()))
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141
    for j in range(n):
        t = N - e[j]*0.006
        tt = abs(M - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
main()
num = [int(i) for i in input().split()]
K = num[0]
X = num[1]
 
ans = [i for i in range(X-K+1, X+K)]
for i in range(2*K+1):
  print(ans[i], end='')

### FIXED CODE ###

num = [int(i) for i in input().split()]
K = num[0]
X = num[1]
 
ans = [i for i in range(X-K+1, X+K)]
for i in range(2*K-1):
  print(ans[i], end=' ')
import math
a,b,x=map(int,input().split())
if a*a*b/2>x:
  print(math.degrees(math.atan(a*a*b/2*x))
else:
        print(math.degrees(math.atan(2-2*x/a*a*b))
        

### FIXED CODE ###

import math
a,b,x=map(int,input().split())
if (a*a*b)/2>x:
  print(math.degrees(math.atan(a*b*b/(2*x))))
else:
  print(math.degrees(math.atan(2*(a*a*b-x)/(a*a*a))))
n, k = [int(i) for i in input().split()]
towns = [int(i) for i in input().split()]
ind_ = 1
ts = []
roop_s = None
for i in range(15):
    ind_ = towns[ind_-1]
    if ind_ in ts:
        roop_s = ts.index(ind_)
        break
    else:
        ts.append(ind_)
init = len(ts[:roop_s])
roop_l = len(ts) - init
roop = ts[roop_s:]
print(roop[((k-init)%roop_l)-1])


### FIXED CODE ###

n, k = [int(i) for i in input().split()]
towns = [int(i) for i in input().split()]
ind_ = 1
ts = []
visited = [0]*n
loop_s = None
while(True):
    ind_ = towns[ind_-1]
    if visited[ind_-1]:
        loop_s = ts.index(ind_)
        break
    else:
        visited[ind_-1] = 1
        ts.append(ind_)
if k <= len(ts):
    print(ts[k-1])
else:
    init = len(ts[:loop_s])
    loop_l = len(ts) - init
    loop = ts[loop_s:]
    print(loop[((k-init)%loop_l)-1])
import math
from sympy import sieve
N=int(input())

num = math.factorial(N)
primeNum = [i for i in sieve.primerange(1,10000000)]
# print(primeNum)
resulNum=[0]*len(primeNum)
result=1

j=0
for i in primeNum:
  while num % i == 0 :
    num = num // i
    resulNum[j]+=1
  j+=1

for i in resulNum:
  if i>0:
    result*=(i+1)
    result %= 10**9+7

print(result)



### FIXED CODE ###

import math
# from sympy import sieve
N=int(input())

num = math.factorial(N)
primeNum=[]

for i in range(2,1000):
  flag=False  
  for j in range(2,i):
    if i%j==0:
      flag=True
      break
  if flag==False:
    primeNum.append(i)
    

# primeNum = [i for i in sieve.primerange(1,1000)]
# print(primeNum)
resulNum=[0]*len(primeNum)
result=1

j=0
flag=False
for i in primeNum:
  while num % i == 0 :
    num = num // i
    resulNum[j]+=1
    flag=True
  
  if flag==True:
    result*=(resulNum[j]+1)
    result %= 10**9+7
  j+=1
  flag=False

print(result)
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**10]*n
dp[0]=0
for i in range(1,n):
    dp[i]=min(dp[j]+min(h[j]-h[i]) for j in range(max(0,i-k),i))
print(dp[n-1])


### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**5]*n
dp[0]=0
for i in range(1,n):
    dp[i]=min(dp[j]+abs(h[j]-h[i]) for j in range(max(0,i-k),i))
print(dp[n-1])
N, A = [int(_) for _ in input().split()]

MAX_I = 2000
memo = [[0] * MAX_I for _ in range(N + 2)]


def cnv(v):
    return v - A + (MAX_I // 2)


X = [int(_) for _ in input().split()]
for i in range(N):
    offset = X[i] - A
    # print('x', offset)

    mm = memo[i]
    for j in range(MAX_I):
        if mm[j] > 0:
            memo[i + 1][j + offset] += mm[j]
        memo[i + 1][j] += mm[j]

    memo[i + 1][cnv(X[i])] += 1

print(memo[N][MAX_I//2])


### FIXED CODE ###

N, A = [int(_) for _ in input().split()]

MAX_I = 5000
memo = [[0] * MAX_I for _ in range(N + 2)]


def cnv(v):
    return v - A + (MAX_I // 2)


X = [int(_) for _ in input().split()]
for i in range(N):
    offset = X[i] - A
    # print('x', offset)

    mm = memo[i]
    for j in range(MAX_I):
        if mm[j] > 0:
            memo[i + 1][j + offset] += mm[j]
        memo[i + 1][j] += mm[j]

    memo[i + 1][cnv(X[i])] += 1

print(memo[N][MAX_I//2])
import numpy as np
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
HH=np.zeros((N,N))
for i in range(M):
  A,B=list(map(int,input().split()))
  HH[A-1][B-1]=1
HH=HH+HH.T
count=0
for i in range(N):
  ma=0
  for j in np.where(HH[i]>0)[0]:
    if(H[i]<=H[j]):
      count+=1
      break
print(N-count)        

### FIXED CODE ###

import numpy as np
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
F=[0]*len(H)
for i in range(M):
  A,B=list(map(int,input().split()))
  if(H[A-1]<H[B-1]):
    F[A-1]=1
  elif(H[A-1]>H[B-1]):
    F[B-1]=1
  else:
    F[B-1]=1
    F[A-1]=1
print(F.count(0))