Problem:


Score : 400 points

Problem Statement

Takahashi has a water bottle with the shape of a rectangular prism whose base is a square of side a~\mathrm{cm} and whose height is b~\mathrm{cm}. (The thickness of the bottle can be ignored.)

We will pour x~\mathrm{cm}^3 of water into the bottle, and gradually tilt the bottle around one of the sides of the base.

When will the water be spilled? More formally, find the maximum angle in which we can tilt the bottle without spilling any water.

Constraints

All values in input are integers.

1 \leq a \leq 100

1 \leq b \leq 100

1 \leq x \leq a^2b

Input

Input is given from Standard Input in the following format:

a b x

Output

Print the maximum angle in which we can tilt the bottle without spilling any water, in degrees.
Your output will be judged as correct when the absolute or relative error from the judge's output is at most 10^{-6}.

Sample Input 1

2 2 4

Sample Output 1

45.0000000000

This bottle has a cubic shape, and it is half-full. The water gets spilled when we tilt the bottle more than 45 degrees.

Sample Input 2

12 21 10

Sample Output 2

89.7834636934

This bottle is almost empty. When the water gets spilled, the bottle is nearly horizontal.

Sample Input 3

3 1 8

Sample Output 3

4.2363947991

This bottle is almost full. When the water gets spilled, the bottle is still nearly vertical.



Sample input:
2 2 4


Sample output:
45.0000000000

Submission status: Accepted

Solution code:
def resolve():
    import math
    a,b,x = map(int, input().split())
    area = x/a
    height = x/(a**2)
    if height == b:
        print(0)
    elif area >= (a*b/2):
        c = b-height
        angle = math.degrees(math.atan(a/(2*c)))
        print(90-angle)
    else:
        d = area*2/b
        angle = math.degrees(math.atan(d/b))
        print(90-angle)
resolve()

Submission status: Accepted

Solution code:
import math
a,b,x = map(int,input().split())
if x / a**2 <= b / 2:
     print(math.degrees(math.atan(b/(2 * x / a / b))))
else:
     print(math.degrees(math.atan(2 * (b - x / a**2) / a)))

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())

if x/(a**2)>=b:
    print(0)
elif x/(a**2)>=b*0.5:
    print(90-math.degrees(math.atan((a*0.5)/(b-x/a**2))))
else:
    print(math.degrees(math.atan(b/(2*x/(a*b)))))

Submission status: Accepted

Solution code:
#144_D
import math
a, b, x = map(int, input().split())
if 2 * x > (a ** 2) * b:
    k = 2 * ((a ** 2) * b - x) / (a ** 3)
    print(math.degrees(math.atan(k)))
else:
    k = a * (b ** 2) / (2 * x)
    print(math.degrees(math.atan(k)))

Submission status: Accepted

Solution code:
from math import atan, degrees

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

if x < a * a * b / 2:
  ans = 90 - degrees(atan(x * 2 / (b * a) / b))
else:
  ans = degrees(atan((a * a * b - x) * 2 / (a**2) / a))
  
print(ans)

Submission status: Accepted

Solution code:
import math

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

V = (a**2)*b

if x < V/2:
    t = (2*x)/(a*b**2)
    print(90 - math.degrees(math.atan(t)))
else:
    t = (2*b/a) - (2*x/a**3)
    print(math.degrees(math.atan(t)))

Submission status: Accepted

Solution code:
import math
def main():
    a, b, x = map(float, input().split())
    thX = a * a * b / 2.0
    if x == (a*a*b):
        print(0)
    elif x <= thX:
        h = 2.0 * x / (a * b)
        deg = math.degrees(math.atan(h / b))
        print(90.0 - deg)
    else:
        c = 2.0 * x / (a*a) - b
        deg = math.degrees(math.atan(a / (b-c)))
        print(90.0 - deg)

main()

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
'''
https://atcoder.jp/contests/abc144/tasks/abc144_d
'''
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7
    import math
    a,b,x = map(int, input().split())
    if a*a*b/2 >= x:
        n = 2*x / (a*b)
        s = b / ((n**2 + b**2)**0.5)
        print(90-math.degrees(math.acos(s)))
    else:
        x = a*a*b - x
        n = 2*x / (a*a)
        s = a / ((n**2 + a**2)**0.5)
        print(math.degrees(math.acos(s)))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())

def fm(a, b, x):
    return (2*x / (a**2)) - b

def fn(a, b, x):
    return 2*x / (a*b)

if fm(a, b, x) >= 0:
    ans = math.degrees(math.atan((b - fm(a, b, x)) / a))
else:
    ans = math.degrees(math.atan(b / fn(a, b, x)))

print(ans)

Submission status: Accepted

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

import math
S = a * b
x /= a

if S < 2*x :
    tanT = 2 * (a * b - x) / (a**2)
else :
    tanT = b ** 2 / (2 * x)

T = math.degrees(math.atan(tanT))
print(T)

Submission status: Accepted

Solution code:
from math import atan,pi

a, b, x = map(int, input().split())
if a**2*b < 2 * x:
    print(180 * atan(2 * (a ** 2 * b - x) / (a ** 3)) / pi)
else:
    print(180 * atan(a * b ** 2 / (2 * x)) / pi)

Submission status: Accepted

Solution code:
import math

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

v = (a**2) * b

if x > v / 2:
	ans = math.degrees(math.atan(2*(b-x/(a**2))/a))
else:
	ans = math.degrees(math.atan(a*(b**2)/(2*x)))
print(ans)

Submission status: Accepted

Solution code:
import math

a,b,x = map(int,input().split())
if x / a <= a * b / 2:
    print(math.degrees(math.atan(a * b * b / 2 / x)))
else:
    q = 2 * b - 2 * x / a / a
    print(math.degrees(math.atan(q / a)))

Submission status: Accepted

Solution code:
import math

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

def calc_theta(a, b, x):
    if x >= 0.5 * a ** 2 * b:
        # tmp = (a ** 3) / (2 * ((a **2) * b - x)) これだと 0divになる
        tmp = (2/a)*(b-(x/a**2))
    else:
        tmp = (a * b * b) / (2 * x)
    return math.degrees(math.atan(tmp))

ans = calc_theta(a, b, x)

print('{:.10f}'.format(ans))

Submission status: Accepted

Solution code:
import math

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

if S > a*b/2:
	P = 2*b - 2*S/a
	theta = math.degrees(math.atan(P/a))
else:
	P = 2*S / b
	theta = math.degrees(math.atan(b/P))

print(theta)

Submission status: Accepted

Solution code:
import math
A,B,X = map(int,input().split())
if(X >= A*A*B/2):
    arctan = (2*(A*A*B-X))/(A**3)
else:
    arctan = A*B*B/(2*X)
ans = math.degrees(math.atan(arctan))
print(ans)

Submission status: Accepted

Solution code:
import math
import sys

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

if maxv == x:
    print(0)
    sys.exit()

if x >= maxv / 2:
    t = 2*b - (2 * x) / a**2
    tan = a / t
    print(90 - math.degrees(math.atan(tan)))
else:
    t = 2*x / (a * b)
    tan = 1 / (b / t)
    print(90 - math.degrees(math.atan(tan)))

Submission status: Accepted

Solution code:
import math
a,b,x = map(int,input().split())
if x>a**2*b/2:
    k = math.degrees(math.atan((2*a**2*b-2*x)/a**3))
else:
    k = math.degrees(math.asin(b/(4*x**2/a**2/b**2+b**2)**0.5))
print(k)

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())
if a**2*b>=2*x:
    print(math.degrees(math.atan2(a*b**2,(2*x))))
else:
    print(math.degrees(math.atan2(2*b*a**2-2*x,a**3)))

Submission status: Accepted

Solution code:
import math
 
a, b, x = map(int, input().split())
if x > a**2*b/2:
  degree = math.degrees(math.atan2(2*a**2*b-2*x, a**3))
  print(degree)
else:
  degree = math.atan2(a*(b**2),2*x)
  print(math.degrees(degree))

Submission status: Accepted

Solution code:
import numpy as np
a, b, x = map(int,input().split())
if x == 0:
    print(90)
elif a * a * b * (1 / 2) >= x:   
    l = (2 * x) / (a * b)
    print(180 / np.pi * np.arctan(b / l))
else:
    l = (2 * (a * a * b - x)) / (a * a)
    print(180 / np.pi * np.arctan(l / a))

Submission status: Accepted

Solution code:
import math

a, b, x = map(int, input().split())
if x > a**2*b/2:
  degree = math.degrees(math.atan2(2*a**2*b-2*x, a**3))
  print(degree)
else:
  degree = math.atan2(2*x, a*(b**2))
  degree = math.pi/2 - degree
  print(math.degrees(degree))

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())
if x == a*a*b:
  print(0)
  exit()
if x/a/a*2>=b:
  h = x/a/a*2-b
  rad = math.atan(a/(b-h))
else:
  rad = math.atan(x/a*2/b/b)
print(90-math.degrees(rad))

Submission status: Accepted

Solution code:
import math

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

if a*a*b == x :
  print(0)
elif a*b/2 >= x/a :
  ax = 2*x/a/b
  print(math.degrees(math.atan(b/ax)))
else : 
  bx = 2*x/a/a - b
  print(90-math.degrees(math.atan(a/(b-bx))))

Submission status: Accepted

Solution code:
import math

a,b,x = map(int,input().split())
if x <= a*a*b/2:
    l = x/a/b*2
    print(math.degrees(math.atan(b/l)))
else:
    l = (a*b - x/a)/a*2
    print(math.degrees(math.atan(l/a)))

Submission status: Accepted

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

div=a/b

from math import tan
from math import degrees
from math import pi

l=0
r=pi/2
for i in range(10000):
    mid=(l+r)/2
    t=tan(mid)
    if t<=div:
        f=a*b*b*t/2
    else:
        f=a*a/2*(2*b-a/t)
    if f<=x:
        l=mid
    else:
        r=mid

print(90-degrees(r))

Submission status: Accepted

Solution code:
def main():
    from math import tan, radians
    a, b, x = (int(i) for i in input().split())

    def is_ok(d):
        if b*tan(radians(90-d)) <= a:
            area = tan(radians(90-d)) * b * b / 2.0
        else:
            area = tan(radians(d)) * a * a / 2.0
            area = a*b - area
        if x / a <= area:
            return True
        else:
            return False

    def binary_search_meguru():
        ok = 0.0
        ng = 90.0
        while abs(ng - ok) > 0.000001:
            mid = ok + (ng - ok) / 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search_meguru())


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import atan2, pi

a, b, x = map(int, input().split())
if a*a*b/2>=x: print(atan2(b, x/a*2/b) * 180 / pi)
else:
        jt = x/a*2/a - b
        print(atan2(b-jt, a) * 180 / pi)

Submission status: Accepted

Solution code:
import sys
from math import atan,pi
def main():
    input = sys.stdin.readline
    a,b,x =map(int, input().split())
    x /= a
    t = 0
    if 2*x < a * b:
        t = atan(b*b/2/x)
    elif 2*x > a * b:
        t = atan((2*a*b-2*x)/a/a)
    else:
        t = pi/4
    ans = t * 180 / pi
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

    a, b, x = 1.0, b / a, x / (a * a * b)
    x *= b

    if x * 2.0 > b:
        print(math.atan((b - x) / 0.5) * (180.0 / math.pi))
    else:
        print(90.0 - math.atan(x * 2 / (b * b)) * (180.0 / math.pi))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from fractions import gcd
from math import sqrt,asin,degrees
from collections import deque,defaultdict,Counter
from heapq import heapify,heappop,heappush
from copy import deepcopy
from itertools import accumulate,permutations
from bisect import bisect_left,bisect_right

a,b,x = map(int,input().split())
 
m = 2*x/a**2 - b
if m >= 0:
    sin = (b-m)/sqrt((b-m)**2+a**2)
    print("{:.7f}".format(degrees(asin(sin))))
else:
    sin = b/sqrt((b**2)+((2*x)/(a*b))**2)
    print("{:.7f}".format(degrees(asin(sin))))

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, atan
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
a,b,x = MAP()
if x > a * b * a / 2: #台形
    ans = atan((2 * b - 2 * x / pow(a, 2)) / a) * 180 / pi
    print(ans)
else:
    ans = atan(pow(b, 2) * a / 2 / x) * 180 / pi
    print(ans)

Submission status: Accepted

Solution code:
from math import atan, pi, degrees
a, b, x = map(int, input().split())
ans = 0
if x > a*a*b/2:
    ans = atan(2*(a*a*b-x)/a**3)
else:
    ans = pi/2 - atan((2*x)/(a*b*b))
print(degrees(ans))

Submission status: Accepted

Solution code:
import math
a,b,x = map(int,input().split())
if 2 * x >= a ** 2 * b:
    A = a
    B = 2 * ((b - (x / (a ** 2))))
else:
    A = (2 * x) / (a * b)
    B = b
#print(A,B)
rad = math.atan2(B,A)
ans = math.degrees(rad)
print(ans)

Submission status: Accepted

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

div=a/b

from math import tan
from math import degrees
from math import pi

l=0
r=pi/2
for i in range(1000):
    mid=(l+r)/2
    t=tan(mid)
    if t<=div:
        f=a*b*b*t/2
    else:
        f=a*a/2*(2*b-a/t)
    if f<=x:
        l=mid
    else:
        r=mid

print(90-degrees(r))

Submission status: Accepted

Solution code:
import math

a, b, x = map(int, input().split())
s_all = (a ** 2) * b
if x <= s_all / 2:
    tmp = (a * b ** 2) / (2 * x)
    tan = math.atan(tmp)
else:
    tmp = 2 * (s_all - x) / (a ** 3)
    tan = math.atan(tmp)
print(math.degrees(tan))

Submission status: Accepted

Solution code:
#D
import math
a,b,x=map(int,input().split())
cap=a**2*b
ans=0
if x<=cap/2:
    n=2*x/(a*b)
    ans=math.atan(b/n)*180/math.pi
else:
    n=2*(cap-x)/(a**2)
    ans=math.atan(n/a)*180/math.pi
print(ans)

Submission status: Accepted

Solution code:
import math

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

if x < a * a * b / 2:
    h = 2 * x / (a * b)
    deg = math.degrees(math.atan(b / h))
else:
    h = 2 * (a * a * b - x) / (a * a)
    deg = math.degrees(math.atan(h / a))

print(deg)

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())

if x/a >= (a*b)/2:
    ans = math.degrees(math.atan((2/a)*(b-(x/a**2))))
else:
    ans = math.degrees(math.atan((a*b*b)/(2*x)))
print('{:.10f}'.format(ans))

Submission status: Accepted

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import heapq
import collections
import itertools
sys.setrecursionlimit(100001)

# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

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

total = a*a*b
flg = x > total/2

if flg:
    b_tmp = 2*(total-x)/a/a
    ans = math.degrees(math.atan(b_tmp/a))
else:
    a_tmp = 2*x/a/b
    ans = math.degrees(math.atan(b/a_tmp))

print(ans)

Submission status: Accepted

Solution code:
#D
import math
a,b,x = map(int,input().split())

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

Submission status: Accepted

Solution code:
def ABC120_D():
    class UnionFind():
        def __init__(self, n):
            self.parent = [-1 for _ in range(n)]
            # 正==子: 根の頂点番号 / 負==根: 連結頂点数

        def find(self, x):
            # 要素xが属するグループの根を返す
            if self.parent[x] < 0:
                return x
            else:
                self.parent[x] = self.find(self.parent[x])
                return self.parent[x]

        def unite(self, x, y):
            # 要素xが属するグループと要素yが属するグループとを併合する
            x, y = self.find(x), self.find(y)
            if x == y:
                return False
            else:
                if self.size(x) < self.size(y):
                    x, y = y, x
                self.parent[x] += self.parent[y]
                self.parent[y] = x

        def same(self, x, y):
            # 要素x, yが同じグループに属するかどうかを返す
            return self.find(x) == self.find(y)

        def size(self, x):
            # 要素xが属するグループのサイズ（要素数）を返す
            x = self.find(x)
            return -self.parent[x]

        def is_root(self, x):
            # 要素の根をリストで返す
            return self.parent[x] < 0

        def roots(self):
            # すべての根の要素をリストで返す
            return [i for i, x in enumerate(self.parent) if x < 0]

        def members(self, x):
            # 要素xが属するグループに属する要素をリストで返す
            root = self.find(x)
            return [i for i in range(self.n) if self.find(i) == root]

        def group_count(self):
            # グループの数を返す
            return len(self.roots())

        def all_group_members(self):
            # {ルート要素: [そのグループに含まれる要素のリスト], ...}の辞書を返す
            return {r: self.members(r) for r in self.roots()}
    N, M = LI()
    P = [[]for _ in range(M)]
    for i in range(M):
        P[i] = LI()
    uf = UnionFind(N)
    ans = [N*(N-1)//2]*M
    for i,[a,b] in enumerate(P[M-1:0:-1]):
        #print(i,a,b)
        a -= 1; b -= 1
        if uf.same(a,b):
            ans[i+1] = ans[i]
        else:
            cur = uf.size(a)*uf.size(b)
            ans[i+1] = ans[i]-cur
            uf.unite(a,b)
    for v in ans[::-1]:
        print(v)
    return

def JOI8_1():
    N = I()
    C = [I()for _ in range(N)]
    prev = C[0]
    BW = [[1,prev]]
    for i in range(1,N):
        #print(BW)
        if BW[-1][1]==C[i]:
            BW[-1][0] += 1
        else:
            if i%2==0:
                BW.append([1,C[i]])
            else:
                if len(BW) > 1:
                    BW[-2][0] += (BW[-1][0] + 1)
                    del BW[-1]
                else:
                    BW[0][0] += 1
                    BW[0][1] = C[i]
    ans = 0
    #print(BW)
    for i,s in BW:
        if s==0:
            ans += i
    print(ans)
    return
"""
8
1
0
1
1
0
0
0
1
"""


def ABC144_D():
    a, b, x = LI()
    half = a*a*b/2
    if x>=half:
        y = (half*2-x)/(a*a/2)
        deg = math.atan2(a,y)
        #print(y,a,deg)
        ans = 90-deg*180/math.pi
    else:
        y = x/(a*b/2)
        deg = math.atan2(b,y)
        ans = deg*180/math.pi
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque

def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    ABC144_D()
"""

"""

Submission status: Accepted

Solution code:
import math

a, b, x = (int(i) for i in input().split())
ma = a*a*b
if ma >= 2*x:
    l = 2*x/(a*b)
    print(math.degrees(math.atan(b/l)))
else:
    l = 2*(a*a*b-x)/(a*a)
    print(math.degrees(math.atan(l/a)))

Submission status: Accepted

Solution code:
import math
a, b, x = list(map(int, input().split()))
if (a * a * b) / 2 <= x:
    res = math.atan(2 * (b * a * a - x) / (a * a * a))
    print(res * 180 / math.pi)
else:
    res = math.atan((a * b * b) / (2 * x))
    print(res * 180 / math.pi)

Submission status: Accepted

Solution code:
from sys import stdin
import math

a, b, x = (int(i) for i in stdin.readline().rstrip().split())

if a*a*b < 2*x:
    c = math.atan(2 * b/a - 2 * x/a ** 3)
    print(math.degrees(c))
else:
    c = math.atan(a * b * b/(2 * x))
    print(math.degrees(c))

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())

if a * a * b == x:
    print(0)
# 台形の場合
elif a * a * b < 2 * x:
    y = 2 * x / (a*a) - b
    print(90 - math.degrees(math.atan(a/(b-y))))

else:
    y = 2 * x / a / b
    print(90 - math.degrees(math.atan(y/b)))

Submission status: Accepted

Solution code:
import sys
import math

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


if(x > a*a*b):
    sys.exit()

if (a*a*b/2 >= x):
    s = math.degrees(math.atan(a*b*b/2/x))
else:
    s = math.degrees(math.atan(2*(a*a*b-x)/a/a/a))

print (s)

Submission status: Accepted

Solution code:
import math


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

if x / a >= 1 / 2 * a * b:
    tan = (2 * b) / a - 2 * x / (a ** 3)
else:
    tan = (b ** 2) * a / (2 * x)

print(math.degrees(math.atan(tan)))

Submission status: Accepted

Solution code:
import math
a,b,x = map(int,input().split())
if (a*a*b/2) < x:
  tan = 2*(a*a*b-x)/(a*a*a)
  arctan = math.atan(tan)
  print(math.degrees(arctan))
else:
  tan = a*b*b/(2*x)
  arctan = math.atan(tan)
  print(math.degrees(arctan))

Submission status: Accepted

Solution code:
a,b,x = [int(i) for i in input().split()]
from math import atan
from math import degrees
def deg(n):
    return degrees(atan(n))
V = a*a*b
if V/2 == x:
    xa = deg(1)
    xa = str(xa) + '0000000000'
    print(xa)
    exit()
if V/2 > x:
    xa = deg(a*b*b/(2*x))
    print(xa)
    exit()
if V/2 < x:
    xa = deg(2*(V-x)/a**3)
    print(xa)
    exit()

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())
if x < (a*a*b/2):
  print(math.degrees(math.atan((a*b*b)/(2*x))))
else:
  print(math.degrees(math.atan((2*b -2*x/(a**2))/a)))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#input
import math
# math.degrees(theta) = theta radian to kodo
# math.atan(math.tan(theta)) = theta
a,b,x = map(int,input().split())
if x <= a*a*b/2:
    tan = (a*b*b)/(2*x)
else:
    tan = 2*(a*a*b-x)/(a**3)
print(math.degrees(math.atan(tan)))

Submission status: Accepted

Solution code:
a,b,x=map(int,input().split())
from math import*

# if a*a*b/2<=x:
#     c=2*x/a/a-b
#     theta=atan((b-c)/a)
#     print(theta*180/pi)
# else:
#     d=a-2*x/b/a
#     theta=atan(b/(a-d))
#     print(theta*180/pi)

def check(theta):
    theta_pi=theta*pi/180
    if a*a*b/2<=x:
        youryo=a*a*0.5*(b+b-a*tan(theta_pi))
    else:
        youryo=a*b*0.5*b/tan(theta_pi)
    
    return youryo>=x
    
top=90 #ng
bottom=0 #ok
while top-bottom>1e-10:
    mid=(top+bottom)*0.5
    if check(mid):
        bottom=mid
    else:
        top=mid
        
print(bottom)

#please

Submission status: Accepted

Solution code:
from math import atan2, degrees

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

vol = a * a * b

if x * 2 <= vol:
    ans = atan2(a * b * b, 2 * x)

else:
    ans = atan2(2 * (vol - x), a ** 3)

ans = degrees(ans)
print(ans)

Submission status: Accepted

Solution code:
# atan

a,b,x=map(int,input().split())
from math import*

if a*a*b/2<=x:
    c=2*x/a/a-b
    theta=atan((b-c)/a)
    print(theta*180/pi)
else:
    d=a-2*x/b/a
    theta=atan(b/(a-d))
    print(theta*180/pi)

Submission status: Accepted

Solution code:
import math
a,b,x=map(float,input().split())
if x>a*a*b/2:
  x=a*a*b-x
  h=x*2/a/a
  print(math.degrees(math.atan(h/a)))
else:
  h=x*2/a/b
  print(math.degrees(math.atan(b/h)))

Submission status: Accepted

Solution code:
import sys
import math
import fractions
import itertools
from collections import deque
import copy
import bisect

MOD = 10 ** 9 + 7
INF = 10 ** 18 + 7
input = lambda: sys.stdin.readline().strip()

a, b, x = map(int, input().split())
if x >= (a ** 2 * b) / 2:
    print(math.atan(2 / a ** 3 * (a ** 2 * b - x)) * (180 / math.pi))
else:
    print(math.atan(a * b ** 2 / (2 * x)) * (180 / math.pi))

Submission status: Accepted

Solution code:
from math import atan,tan,pi

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

def max_volume(theta):
    
    theta = theta/180*pi
    if theta<atan(b/a):
        
        area = a*b-a*a*tan(theta)/2
    else:
        area = b*(b/tan(theta))/2
    return area*a

left = 0 
right = 90 
while right - left > 1e-7:
    mid = (left+right)/2
    if max_volume(mid) <= x:
        right = mid
    else:
        left = mid

answer = (left+right)/2
print(answer)

Submission status: Accepted

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

from math import atan, degrees
if x>=a*a*b/2:#半分よりも多い場合
    rad=atan(2/a*(b-x/a**2))
else:
    rad=atan((a*b*b)/(2*x))
print(degrees(rad))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	a,b,x = inputMap()

	x = x/a
	tmp = a*b

	ans = 0
	#print("{} {}".format(tmp,x))
	if tmp/2 <= x:
		S = a*b
		tmptmp = (2*(S-x))/a
		ans = math.degrees(math.atan2(tmptmp, a))
	else:
		tmptmp = 2*x/b
		ans = math.degrees(math.atan2(b, tmptmp))
		#ans = 90 -ans

	print(ans)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# special thanks :
#  https://nagiss.hateblo.jp/entry/2019/07/01/185421
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import sys
from fractions import gcd
from itertools import permutations, combinations, accumulate
from collections import deque
from heapq import heappush, heappop, heapify
from collections import deque
import math

input = sys.stdin.readline
sys.setrecursionlimit(10**6)

MOD = 10**9 + 7

def main():
    a, b, x = tuple(map(int,input().split()))
    pi = 3.141592653589

    ng = 90
    ok = 0

    if (a**2 * b)/2 < x:
        tan = 2 * ((b / a) - (x / a ** 3))
        while abs(ng-ok) > 10**(-7):
            mid = (ng + ok) /2
            if math.tan(math.radians(mid)) <= tan:
                ok = mid
            else:
                ng = mid
    else:
        tan = (a * b**2) / (2 * x)
        while abs(ng-ok) > 10**(-7):
            mid = (ng + ok) /2
            if math.tan(math.radians(mid)) <= tan:
                ok = mid
            else:
                ng = mid

    print(ok)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())

if a**2*b < 2*x:
    hight = (a ** 2 * b - x)/((a**2/2))
    bottom = a

else:
    hight = b

    area = a * hight

    bottom = 2 * x / area

print(math.degrees(math.atan2(hight, bottom)))

Submission status: Accepted

Solution code:
A,B,X = map(int , input().split() )

import math

M = A * A * B
if X >= M/2:
  m = A*A*B
  C = 2*(m-X) / (A*A)
  ans = math.atan2(C,A) / math.pi*180  
  
else:
  C = (2*X)/(A*B)
  ans = math.atan2(B,C) / math.pi*180  
  
print(ans)

Submission status: Accepted

Solution code:
# https://img.atcoder.jp/abc144/editorial.pdf

def main():
    from math import pi, tan, radians

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

    def volume(theta: float):
        """傾けた直方体に存在できる水の体積
        水面を地面に対し平行にした図を描き
        tanを用いると計算できる"""
        theta = radians(theta)
        if a * tan(theta) <= b:  # 台形
            return a * a * b - a * a * a * tan(theta) / 2
        else:  # 三角形
            return a * b * b * tan(pi / 2 - theta) / 2

    def is_ok(theta):
        return volume(theta) >= x

    def binary_search():
        small, large = 0, 90
        for _ in range(30):
            mid = (small + large) / 2
            if is_ok(mid):
                small = mid
            else:
                large = mid
        return small

    ret = binary_search()
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())
if (a*a*b)>=2*x:
  h=x/(b*(a/2))
  print(90-math.degrees(math.atan(h/b)))
else:
  h=(((x/a)*2)/a)-b
  b-=h
  if b!=0:
    print(90-math.degrees(math.atan(a/b)))
  else:
    print(0)

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())
y = x/a
if y <= a*b/2:
  theta = 90 - math.degrees(math.atan(2*y/(b**2)))
else:
  theta = math.degrees(math.atan(2*(a*b-y)/(a**2)))
print(theta)