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: Time Limit Exceeded

Solution code:
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools
import queue
from collections import deque
from fractions import Fraction


def get_max(a, b, theta):
    kari = b * math.tan(math.radians(90 - theta))
    if kari > a:
        S = (a * b) - (a * (a * math.tan(math.radians(theta))) / 2)
    else:
        S = (kari * b) / 2
    max_water = S * a
    return max_water




def main():
    a, b, x = map(int, input().split())
    left, right = 0, 90

    for i in range(100000):
        half = (left + right) / 2
        max_water = get_max(a, b, half)
        if max_water >=x:
            left = half
        else:
            right = half

    print(left)





if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    a, b, x = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    import math
    import bisect
    #台形の場合
    if 2*x / (a**2) >= b:
        Down = [(x/(a**2) + a * math.tan(math.pi * i /(2* 9*10**7)) /2) for i in range(9*10**7)]
        ind = bisect.bisect_left(Down, b)

    # 三角形の場合
    else:
        Down = [math.sqrt(2*x /a * math.tan(math.pi * i /(2* 9*10**7))) for i in range(9*10**7)]
        ind = bisect.bisect_left(Down, b)

    print(float(ind/10**6))
resolve()

Submission status: Time Limit Exceeded

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import atan, tan, pi

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


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


low = 0
high = 90
while high - low > 1e-7:
    mid = (low + high) // 2
    if max_v(mid) <= x:
        high = mid
    else:
        low = mid
print((high + low) / 2)

Submission status: Time Limit Exceeded

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import atan, tan, pi

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


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


low = 0
high = 90
while high - low > 1e-7:
    mid = (low + high) // 2
    if max_v(mid) <= x:
        high = mid
    else:
        low = mid
print((high + low) / 2)

Submission status: Time Limit Exceeded

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(100000):
    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: Time Limit Exceeded

Solution code:
import math
# Calculate amount of water that won't oveflow
def calc(a,b,deg): 
    
    rad = math.radians(deg)
    # deg90_in_rad = math.radians(90)
    # a_sect = a*math.sin(rad) - b*math.sin(deg90_in_rad - rad)
    # b_sect = b*math.sin(deg90_in_rad - rad) - a*math.sin(rad) # 縦と水の切片

    # if b_sect >= 0:
    #     sqr_a = a * b_sect 
    #     tri_a = (b-b_sect)*a*1/2  

    # else:
    #     sqr_a = 0
    #     tri_a = (a - a_sect) * b *1/2
    # total_area = (sqr_a + tri_a) 

    if b*math.tan(math.pi/2-rad) <= a:
        total_area = (b*math.tan(math.pi/2-rad)*b*1/2)
    if b*math.tan(math.pi/2-rad)>a:
        total_area = (a*b - a*math.tan(rad)*a*1/2)       

    return total_area * a

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

    left = 0
    right = 90
    deg = 45
    while True:
        y = calc(a, b, deg)
        if y - x >= -10 ** -12 and y - x <= 0:
            break
        if y > x:
            deg, left = (right+deg)/2, deg
        elif y < x:
            deg, right = (left+deg)/2, deg
    print(deg)

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
import math
# Calculate amount of water that won't oveflow
def calc(a,b,deg): 
    
    rad = math.radians(deg)
    deg90_in_rad = math.radians(90)
    a_sect = a*math.sin(rad) - b*math.sin(deg90_in_rad - rad)
    b_sect = b*math.sin(deg90_in_rad - rad) - a*math.sin(rad) # 縦と水の切片

    if b_sect >= 0:
        sqr_a = a * b_sect 
        tri_a = (b-b_sect)*a*1/2  

    else:
        sqr_a = 0
        tri_a = (a - a_sect) * b *1/2

    if b*math.tan(math.pi/2-rad)>a:
        return (a*b - a*math.tan(rad)*a*1/2) *a
    else:
        return b*math.tan(rad/2-rad)*b*1/2*a
    # print(a_sect, b_sect)
    return (sqr_a + tri_a) * a

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

    left = 0
    right = 90
    deg = 45
    while True:
        y = calc(a, b, deg)
        if abs(y - x) < 10**-6:
            break
        if y > x:
            deg, left = (right+deg)/2, deg
        elif y < x:
            deg, right = (left+deg)/2, deg
        
    print(deg)

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
import math
# Calculate amount of water that won't oveflow
def calc(a,b,deg): 
    
    rad = math.radians(deg)
    deg90_in_rad = math.radians(90)
    a_sect = a*math.sin(rad) - b*math.sin(deg90_in_rad - rad)
    b_sect = b*math.sin(deg90_in_rad - rad) - a*math.sin(rad) # 縦と水の切片

    if b_sect >= 0:
        sqr_a = a * b_sect 
        tri_a = (b-b_sect)*a*1/2  

    else:
        sqr_a = 0
        tri_a = (a - a_sect) * b *1/2

    if b*math.tan(math.pi/2-rad)>a:
        return (a*b - a*math.tan(rad)*a*1/2) *a
    else:
        return b*math.tan(rad/2-rad)*b*1/2*a
    # print(a_sect, b_sect)
    return (sqr_a + tri_a) * a

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

    left = 0
    right = 90
    deg = 45
    while True:
        y = calc(a, b, deg)
        if abs(y - x) < 10**-12:
            break
        if y > x:
            deg, left = (right+deg)/2, deg
        elif y < x:
            deg, right = (left+deg)/2, deg
        
    print(deg)

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
import math


def f(a: float, b: float, theta: float) -> float:
    # 求める角度をθとすると三角形の底辺はb*tan(π/2-θ)となる
    # つまり以下の条件を満たす最大のθを求めればよい
    # b*tan(π/2-θ) * b * 1/2 >= x / a
    if theta > (90.0 - 0.0000000001):
        return 0.0
    t = b * math.tan(math.radians(90.0 - theta))
    if t <= a:
        return b * t / 2
    else:
        top = b - (a * math.tan(math.radians(theta)))
        return (b + top) * a / 2


def water_bottle(a: int, b: int, x: int) -> float:
    ok = 90.0
    ng = 0.0
    water = x / a
    for _ in range(100000):
        mid = (ok + ng) / 2.0
        if f(a, b, mid) < water:
            ok = mid
        else:
            ng = mid
    return ok


if __name__ == '__main__':
    abx = list(map(int, input().split()))
    result = water_bottle(abx[0], abx[1], abx[2])
    print(result)

Submission status: Time Limit Exceeded

Solution code:
import math
a,b,x = map(int, input().split())
def f(a,b,t):
  if t < math.atan(a/b): return a*a*b - a*a*a*math.tan(t)/2
  elif t > math.atan(a/b): return a*b*b*math.tan(math.pi/2-t)/2
  else: return a*a*b/2

eps = 1e-10
err = x-f(a,b,math.atan(a/b))
if abs(err) < eps:
  print(math.degrees(math.atan(a/b)))
else:
  if err > 0:
    ths = [(math.atan(a/b) - 0)*i/3 for i in range(4)]
  else:
    ths = [(math.pi/2-math.atan(a/b))*i/3+math.atan(a/b) for i in range(4)]

  abs_err = [abs(x-f(a,b,th)) for th in ths]
  while min(abs_err) > eps:
    err = [x-f(a,b,th) for th in ths]
    abs_err = list(map(abs,err))
    n_i = err.index(max([e for e in err if e<0]))
    p_i = n_i+1
    ths = [(ths[p_i]-ths[n_i])*i/3+ths[n_i] for i in range(4)]

  print(math.degrees(ths[abs_err.index(min(abs_err))]))

Submission status: Time Limit Exceeded

Solution code:
import math
a,b,x = map(int, input().split())
def f(a,b,t):
  if t < math.atan(a/b): return a*a*b - a*a*a*math.tan(t)/2
  elif t > math.atan(a/b): return a*b*b*math.tan(math.pi/2-t)/2
  else: return a*a*b/2
  
th = [math.atan(a/b), 0, math.pi/2]
err = float("inf")
eps = 1e-6
while abs(err) > eps:
  err = x - f(a,b,th[0])
  if abs(err) < eps: break
  elif err < 0:
    th[0], th[1] = (th[2]-th[0])/2+th[0], th[0]
  elif err > 0:
    th[0], th[2] = (th[0]-th[1])/2+th[1], th[0]
    
  #print(err, th)
print(math.degrees(th[0]))

Submission status: Time Limit Exceeded

Solution code:
import math
y = list(map(int, input().split()))
a = y[0]
b = y[1]
x = y[2]

error = 1000


if 2 * x > a * a * b:
  th = 45
  while th <= 90:
    tmp = (((a * a) / math.sin(2 * th) + (a * b)/math.tan(th) - (a * a)/(math.tan(th) * math.tan(th))) * a - x)
    if tmp < error:
      ans = th
      error = tmp
    th += 0.00001
else:
  th = 0
  while th <= 45:
    tmp = ((b * b * math.tan(th)) / 2) * a - x
    if tmp < error:
      ans = th
      error = tmp
    th += 0.00001

print(th)

Submission status: Time Limit Exceeded

Solution code:
import math


a, b, x = map(int, input().split())
eps = 10 ** -6
r = 90 * 10 ** 6
h1 = x / a ** 2
if h1 >= b / 2:
    for e in range(0, r):
        th = e * eps * (math.pi / 180)
        c = b - h1 - (a / 2 * math.tan(th))
        if c <= 0:
            break
    print(e * eps)
else:
    h2 = x / (a * b)
    for e in range(0, r):
        th = e * eps * (math.pi / 180)
        c = 2 * h2 - (b * math.tan(th))
        if c <= 0:
            break
    print(90 - e * eps)

Submission status: Time Limit Exceeded

Solution code:
import math as m

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

x = float(x)
d_max = float(90)
d_min = float(0)
res = float(100)

if x >= a**2*b:
    print(0)
    exit()

if x < a*a*b/100:
    d_max = float(1)

while res > 10e-8:
    d_mid = (d_max+d_min)/2
    l1 = a*m.tan(d_mid/180*m.pi)
    if l1-b > 0:
        l2 = (l1-b)*m.tan((90-d_mid)/180*m.pi)
    else:
        l2 = 0
    v = a*(a*b - 1/2*a*l1 + 1/2*(l1-b)*l2)
    res = abs(x-v)
    if x - v < 0:
        d_min = d_mid
    else:
        d_max = d_mid
print(d_mid)

Submission status: Time Limit Exceeded

Solution code:
import math as m

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

x = float(x)
d_max = float(90)
d_min = float(0)
res = float(100)

if x >= a**2*b:
    print(0)
    exit()

while res > 10e-8:
    d_mid = (d_max+d_min)/2
    l1 = a*m.tan(d_mid/180*m.pi)
    if l1-b > 0:
        l2 = (l1-b)*m.tan((90-d_mid)/180*m.pi)
    else:
        l2 = 0
    v = a*(a*b - 1/2*a*l1 + 1/2*(l1-b)*l2)
    res = abs(x-v)
    if x - v < 0:
        d_min = d_mid
    else:
        d_max = d_mid
print(d_mid)

Submission status: Time Limit Exceeded

Solution code:
import math as m

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

x = float(x)
d_max = float(90)
d_min = float(0)
res = float(100)

if x == a**2*b:
    print(0)
    exit()

while res > 10e-8:
    d_mid = (d_max+d_min)/2
    l1 = a*m.tan(d_mid/180*m.pi)
    if l1-b > 0:
        l2 = (l1-b)*m.tan((90-d_mid)/180*m.pi)
    else:
        l2 = 0
    v = a*(a*b - 1/2*a*l1 + 1/2*(l1-b)*l2)
    res = abs(x-v)
    if x - v < 0:
        d_min = d_mid
    else:
        d_max = d_mid
print(d_mid)

Submission status: Time Limit Exceeded

Solution code:
a,b,x=map(int,input().split())
def water(a,b,x):
  import math
  if math.tan(math.radians(x))<=b/a:
    return (((a**2)*math.tan(math.radians(x))))/2+a*(b-a*math.tan(math.radians(x)))
  else:
    return b**2/(2*math.tan(math.radians(x)))

p=0
q=90
r=0
while r<=1000000:
  if water(a,b,(p+q)/2)<=x/a:
    p=p
    q=(p+q)/2
    r=r+1
  else:
    p=(p+q)/2
    q=q
    r=r+1

print((p+q)/2)

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((2*b-2*x/a**2)/a)))
else:
    print(90-math.degrees(math.atan(2*x/(a*b**2))))

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())
c = x/a**2  # c : height of water

if c >= b/2:
    tanth = 2*(b-c)/a
    deg = math.atan(tanth)*180/math.pi
else:
    tanth = b**2/(2*a*c)
    deg = math.atan(tanth)*180/math.pi

print(deg)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

#import
import math
#import numpy as np
#= int(input())
#= input()
a, b, x= map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= [int(input()) for _ in range(N)]
#= {i:[] for i in range(N)}

d = a * a * b

# 半分より多い
if x * 2 > d:
    x = d - x
    xx = 2 * x / (a * a * a)
    theta = math.atan(xx)
    print(theta * 180 / math.pi)

else:
    xx = 2 * x / (a * b * b)
    theta = math.atan(xx)
    print(90 - theta * 180 / math.pi)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy

a, b, x = map(int, input().split())
if a * b / 2 < x / a:
    theta = numpy.arctan(2 * (b / a - x / a ** 3))
else:
    theta = numpy.arctan(a * b ** 2 / 2 / x)

theta = numpy.rad2deg(theta)
print(theta)

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())
s = x/a
half = (a*b)/2

if s<=half:
    y = (2*s)/b
    z = math.sqrt(b**2+y**2)
    alpha = b/z
    alpha = math.asin(alpha)
    alpha = math.degrees(alpha)

    print(alpha)

if s>half:
    z = math.sqrt(b**2+a**2)

    alpha = b/z
    alpha = math.asin(alpha)
    alpha = math.degrees(alpha)

    beta = a/z
    beta = math.asin(beta)
    beta = math.degrees(beta)

    l = 2*(s-half)/(math.sin(math.radians(90-alpha))*z)
    k = math.sqrt(z**2+l**2-2*l*z*math.cos(math.radians(90-alpha)))

    gamma = 2*(s-half)/(k*z)
    gamma = math.asin(gamma)
    gamma = math.degrees(gamma)

    print(90-(gamma+beta))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b,x = [ int(r) for r in input().split(' ') if len(r) > 0]

if 2*x >= a*a*b:
    print(90-math.degrees((math.atan2(a,2*(b-x/a**2)))))
else:
    print(90-math.degrees(math.atan2((2*x)/(a*b),b)))

Submission status: Accepted

Solution code:
import math

a, b, x = [int(n) for n in input().split()]
v = a**2 * b /2
#print(v, x)

if v == x:
    theta = math.atan(b/a)

elif v > x:
    theta = math.atan(a*(b**2)/(2*x))
elif v < x:
    theta = math.atan(2/a*(b-x/a**2))
    
print(math.degrees(theta))

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

a,b,x = I()

if a**2*b <= 2*x:
  ama = a**2*b-x
  ran = 2*ama/(a**2)
  print(90-180/math.pi*math.atan2(a,ran))
else:
  ran = 2*x/(a*b)
  print(90-180/math.pi*math.atan2(ran,b))

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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/2:
  print(90 - math.degrees(math.atan(a**3/(2*a**2*b-2*x))))
else:
  
  print((90 - math.degrees(math.atan(2*x/(a*b**2)))))

Submission status: Accepted

Solution code:
### ----------------
### ここから
### ----------------

import sys
import math
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    a,b,x=map(int, readline().rstrip().split())
    if x <= a*a*b/2:
        l = x*2/b/a
        print(math.degrees(math.atan(b/l)))
        return
    l = (2*x)/(a*a)-b
    print(math.degrees(math.atan((b-l)/a)))
    #arr=list(map(int, readline().rstrip().split()))
    #n=int(readline())
    #ss=readline().rstrip()
    #yn(1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Accepted

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

if x > a*a*b / 2:
    print(math.atan(2*(a*a*b - x) / (a*a*a)) * (180 / math.pi))
else:
    print(math.atan(a*b*b/(2*x)) * (180 / math.pi))

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    a,b,x = MI()
    a2b = (a**2)*b
    a3 = (a**3)/2
    ab2 = a*(b**2)/2
    
    pai = math.pi/2
    low = 0
    high = math.pi/2
    mid = (low+high)/2
    
    while high - low > 0.0000000000001:
        if a * math.tan(pai-mid) < b:
            v = a2b - a3 * math.tan(pai-mid)
        else:
            v = ab2 * math.tan(mid)
        
        if v < x:
            low = mid
        else:
            high = mid
            
        mid = (low+high)/2

    print(90 - math.degrees(mid))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution 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-x)/(a*a*a))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import tan, atan2, pi, degrees


def f(theta):
    if theta < thres:
        return V - a ** 3 * tan(theta) / 2
    else:
        return a * b * b / tan(theta) / 2


eps = 1e-9
a, b, x = map(int, input().split())
V = a * a * b
thres = atan2(b, a)

bad, good = pi / 2, 0
while bad - good > eps:
    mid = (bad + good) / 2
    if f(mid) >= x:
        good = mid
    else:
        bad = mid
print(degrees(good))

Submission status: Accepted

Solution code:
import math

a, b, x = map(int, input().split())
v = a*a*b
if v == x:
    print(0)
elif v/2 <= x < v:
    h = 2*(v-x)/a**2
    ans = math.atan(h/a)
    print(math.degrees(ans))
else:
    h = 2*x/(b*a)
    ans = math.atan(h/b)
    print(90-math.degrees(ans))

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
INF = float('inf')
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())
a,b,x = readInts()
x /= a
import math
PI = math.pi
if x > a*b//2:
    print("{:.10}".format(math.atan2((a*b-x)*2, a*a)*180/PI))
else:
    print("{:.10}".format(math.atan2(b*b, x*2)*180/PI))

Submission status: Accepted

Solution code:
from math import pi
from math import atan2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import atan, pi

a, b, x = map(int, input().split())
if a * a * b > 2 * x:
    ans = atan(a * b * b / 2 / x)
else:
    ans = atan((2 * a * a * b - 2 * x) / a / a / a)

ans *= 180 / pi
print(ans)

Submission status: Accepted

Solution code:
a, b, x = map(int, input().split())
if x > (a**2)*b/2:
    t = 2*((a**2)*b-x)/(a**3)
else:
    t = a*(b**2)/(2*x)

import math
ans = math.degrees(math.atan(t))
print(ans)

Submission status: Accepted

Solution code:
import math
a, b, x = [int(i) for i in input().split()]
if a**2 * b / 2 <= x:
  y = 2 * x / a**2 - b
  tntheta = (b - y) / a
else:
  y = a - 2 * x / (a * b)
  tntheta = b / (a - y)
print(math.degrees(math.atan(tntheta)))

Submission status: Accepted

Solution code:
import math

def f(d):
  theta = d * math.pi /180
  if a * math.tan(theta) <= b:
    return a*a*b - a*a*a*math.tan(theta)/2
  else:
    return a*b*b/(2*math.tan(theta))

a, b, x = map(int, input().split())
l, r = 0.0, 90.0
for i in range(1000):
  m = (l+r)/2
  if f(m) <= x: r = m
  else: l = m
print('{0:.10f}'.format(l))

Submission status: Accepted

Solution code:
import math

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

vol = a * a * b

if x <= vol // 2:
    tmp = 2 * x / (a*b)
    ans = math.atan(b / tmp)
else:
    tmp = 2 * x / (a**2) - b
    tmp = b - tmp
    ans = math.atan(tmp / a)
print(math.degrees(ans))

Submission status: Accepted

Solution code:
import math
a,b,x = [ int(r) for r in input().split(' ') if len(r) > 0]

if 2*x >= a*a*b:
    # 半分より多い
    print(90-math.degrees((math.atan2(a,2*(b-x/a**2)))))
else:
    # 半分より少ない
    print(90-math.degrees(math.atan2((2*x)/(a*b),b)))

Submission status: Accepted

Solution code:
# ABC144 D
from math import atan2,pi

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy
a,b,x=map(int,input().split())
V=a*a*b
if x<=V/2:
    y=2*x/b/a
    theta=numpy.arctan(b/y)
    print(theta*360/2/numpy.pi)
else:
    x=V-x
    y=2*x/a/a
    theta=numpy.arctan(y/a)
    print(theta*360/2/numpy.pi)

Submission status: Accepted

Solution code:
import math as m
a,b,x=map(int,input().split())
x/=a
P=m.acos(-1.0)
if x>a*b/2:print(m.atan2((a*b-x)*2,a*a)*180/P)
else:print(m.atan2(b*b,x*2)*180/P)

Submission status: Accepted

Solution code:
from math import *
a,b,x=map(int,input().split())
x=x/a
if x<=a*b/2:
  t=2*x/b
  c=sqrt(b**2+t**2)
  ans=90-degrees(asin(t/c))
else:
  t=2*(a*b-x)/a
  c=sqrt(a**2+t**2)
  ans=90-degrees(asin(a/c))
print(ans)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
from math import atan, degrees
a,b,x= map(int,input().split())
yoseki = a**2*b
if x <= yoseki/2:
    # b*y*a/2==x
    y= 2*x/b/a
    # ９０からシータを引けば良い
    print(90-degrees(atan(y/b)))
else:
    # a*y*a/2==yoseki-x
    y = 2*(yoseki-x)/a**2
    print(degrees(atan(y/a)))

Submission status: Accepted

Solution code:
import numpy as np
a,b,x=map(int,input().split())
if x<=a*a*b/2:
  y=2*x/(a*b)
  print(360/((2*np.pi)/np.arctan(b/y)))
else:
  y=2*x/(a**2)-b
  print(360/((2*np.pi)/np.arctan((b-y)/a)))

Submission status: Accepted

Solution code:
from math import*
A,B,X = map(int,input().split())
V = A*A*B

if V/2<X:
  print(degrees(atan(2*(V-X)/A**3)))
else:
  print(degrees(atan(A*B*B/2/X)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
pi=math.pi
def rtod(rad):
    return 180/pi*rad
a,b,x=map(int,input().split())


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

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    a,b,x = LI()
    ok = 0
    ng = 90

    while ng - ok >= 10**(-8):
        middle = (ng+ok) /2
        volume = 0

        if a*math.tan(math.radians(middle)) <= b:
            volume = a**2*b - a**3*math.tan(math.radians(middle))/2
        else:
            volume = a*b**2/(2*math.tan(math.radians(middle)))
        if volume >= x:
            ok = middle
        else:
            ng = middle
    
    ans = ok
    print(ans)
main()