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:
import math
a,b,x = map(int,input().split())
if x>a*a*b/2:
    y = math.degrees(math.atan( 2*b/a-2*x/a**3 ))
else:
    y = math.degrees(math.atan( a*b**2/(2*x) ))
print(y)

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*b/a-2*x/a**3)))
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())


if x/a >= b*a/2:

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

else:
    
    y= 2*x/(a*b)

    print(math.degrees(math.atan(b/y)))

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

Submission status: Accepted

Solution code:
import math

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

if a ** 2 * b / 2 <= x:
    num = (2 * (a ** 2 * b - x)) / (a ** 3)
else:
    num = b ** 2 * a / (2 * x)

print(math.degrees(math.atan(num)))

Submission status: Accepted

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

ans = tan * 180 / math.pi

print(ans)

Submission status: Accepted

Solution code:
import math

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())
h = x / (a ** 2)
if h > b / 2:
    l = (2 * b) - (2 * x / a / a)
    ans = math.degrees(math.atan(l / a))
elif 2 * x == a * a * b:
    ans = math.degrees(math.atan(b / a))
else:
    l = 2 * x / a / b
    ans = math.degrees(math.atan(b / l))
print("{:.10f}".format(ans))

Submission status: Accepted

Solution code:
# 水が側面（量が多い）と底面（少ない）の場合分けをする
# (ab - 1/2*a*atanθ) = x
import math

a, b, x = map(int, input().split())
S = x/a # 水を平面にする
radian = 0
if S >= a*b/2:
  h = (a*b-S) * 2/a
  radian = math.atan2(h, a)
else:
  w = S*2/b
  radian = math.atan2(b, w)
deg = radian/(2*math.pi)*360
print(deg)

Submission status: Accepted

Solution code:
import math

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

if x > (a*a*b/2):
	result = 180/math.pi*math.atan(2*b/a-2*x/(a**3))
else:
	result = 90 - 180/math.pi*math.atan(2*x/(a*b*b))

print(result)

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((a**2*b-x)/(a**3*0.5)))) # 水多い
else:
    print(90-math.degrees(math.atan((x)/(a*b**2*0.5)))) # 水少ない

Submission status: Accepted

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


def main():
    a, b, x = input_line(int, int, int)
    if a ** 2 * b / 2 < x:
        tt = 2 * (a ** 2 * b - x) / a ** 3
    else:
        tt = a * b ** 2 / (2 * x)
    t = math.degrees(math.atan(tt))
    print(t)


def input_line(*types):
    if len(types) == 1:
        return types[0](input())
    else:
        return [t(x) for t, x in zip(types, input().split())]


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from math import pi, atan2

a, b, x = [int(x) for x in input().split()]
# a, b, x = [2, 2, 4]
# a, b, x = [12, 21, 10]
# a, b, x = [3, 1, 8]

s = x / a

if s < (a * b) / 2:
    # w = (2 * s) / b コース
    w = (2 * s) / b
    rad = atan2(b, w)
else:
    # h = ((a * b - s) * 2) / a コース
    h = ((a * b - s) * 2) / a
    rad = atan2(h, a)

# radian から角度への変換 [radian に (180 / pi) をかける]
print(rad * (180 / pi))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def getRightTryangleAngle(base, area):
    height = 2.0 * area / base
    radian = math.atan(height / base)
    return math.degrees(radian)

a, b, x = map(float, input().split())
area = x / a
if area < (a * b) / 2:
    degree = 90.0 - getRightTryangleAngle(b, area)
else:
    degree = getRightTryangleAngle(a, a * b - area)

print('{:.6f}'.format(degree))

Submission status: Accepted

Solution code:
from math import atan, degrees

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

Submission status: Accepted

Solution code:
# D Water_Bottle
import math
a,b,x = map(int,input().split(" "))
x /= a
if (x == a*b):
    #水筒が満タンの場合
    print(0)
elif (x > a*b/2):
    #水筒の半分の容積より水の容積が大きかった場合
    ha = a/2
    print(90-math.degrees(math.atan(ha/(b-(x/a)))))
else:
    #水の容積が水筒の半分の容積以下だった場合
    c = 2*x/b
    print(90-math.degrees(math.atan(c/b)))

Submission status: Accepted

Solution code:
def p_a():
    A, B = map(int, input().split())
    print(A * B if A < 10 and B < 10 else -1)


def p_b():
    N = int(input())
    for i in range(1, 10):
        for j in range(1, 10):
            if N == i * j:
                print("Yes")
                exit()
    print("No")


import math


def p_c():
    N = int(input())
    m = int(math.sqrt(N))

    for i in reversed(range(1, m + 1)):
        if N % i == 0:
            print(i + N // i - 2)
            break


def p_d():
    a, b, x = map(int, input().split())
    if 2 * x / a ** 2 >= b:
        h = b - x / a ** 2
        w = a / 2
        ans = math.degrees(math.atan(h / w))
    else:
        h = b
        w = 2 * x / (a * b)
        ans = math.degrees(math.atan(h / w))
    print(ans)


def p_e():
    pass


def p_f():
    pass


if __name__ == '__main__':
    p_d()

Submission status: Accepted

Solution code:
import math
a, b, x = list(map(float, input().split()))
y = 2 * x / (a * b)
if y > a:
  y = 2 * (a * a * b - x) / (a * a)
  a = math.atan(y / a)
else:
  a = math.atan(b / y)
print(a / math.acos(-1.0) * 180)

Submission status: Accepted

Solution code:
import numpy as np

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

if((2*x/a)>a*b):
    check = a*b - (x/a)
    max_ = 2*check/a
    max_ = max_/a
    max_ = np.arctan(max_)*180/(np.arctan(1)*4)
    print(max_)
else:
    check = 2*x/a/b
    max_ = b/check
    max_ = np.arctan(max_)*180/(np.arctan(1)*4)
    print(max_)

Submission status: Accepted

Solution code:
from math import *

def check(a,b,mid):
   # if mid>pi/2-ep:
    #    return 0
  #  aa=tanh(90-mid)*b
    if a*tan(mid)<=b:
        ans=a*a*b
        aa=a*tan(mid)*a*a
        ans-=(aa)/2.0
    else:
        
        ans=(a*b*b/tan(mid))/2.0
    return ans
        
a,b,x=map(int,input().split())

low=0
high=pi/2
ep=0.0000000001
while low<high and high-low>=ep:
    mid=(low+high)/2
   # print(mid)
    st=check(a,b,mid)
   # print(st)
    
    if st<x:
        high=mid
    else:
        low=mid
print(low/pi*180)

Submission status: Accepted

Solution code:
from math import *

def check(a,b,mid):
    if mid>pi/2-ep:
        return 0
  #  aa=tanh(90-mid)*b
    if a*tan(mid)<=b:
        ans=a*a*b
        aa=a*tan(mid)*a*a
        ans-=(aa)/2.0
    else:
        
        ans=(a*b*b/tan(mid))/2.0
    return ans
        
a,b,x=map(int,input().split())

low=0
high=pi/2
ep=0.0000000001
while low<high and high-low>=ep:
    mid=(low+high)/2
   # print(mid)
    st=check(a,b,mid)
   # print(st)
    
    if st<x:
        high=mid
    else:
        low=mid
print(low/pi*180)

Submission status: Accepted

Solution code:
# -*- coding utf-8 -*-
import math

MOD = 10 ** 9 + 7

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

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

ans = theta

print(ans)

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

Submission status: Accepted

Solution code:
from math import degrees, atan2

def max_degree(a, b, x):
  full = a ** 2 * b
  half = full / 2
  if x == half:
    return 45
  elif x < half:
    e = (x * 2)/ (a * b)
    return degrees(atan2(b, e))
  else:
    e = ((full - x) * 2) / (a * a)
    return degrees(atan2(e, a))
    

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

Submission status: Accepted

Solution code:
import math

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

s = x / a # 二次元上で見た水の面積
if s >= (a*b / 2): # パターン1
	h = (2 * (a*b - s)) / a
	result = math.degrees(math.atan2(h, a)) #得られたラジアンを度に変換

else: # パターン2
	w = 2*s / b
	result = math.degrees(math.atan2(b, w))

print(result)

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:
import math

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

if x/(a**2)/b < 1/2:
    print(180*math.atan((a*b**2)/(2*x))/math.pi)

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

Submission status: Accepted

Solution code:
import math

a, b, x = [int(_) for _ in input().split()]

s = x / a
if a * b / 2 < s:
    b2 = 2 * (a * b - s) / a
    ans = math.atan2(b2, a) * 180 / math.pi

else:
    a2 = 2*s/b
    ans = math.atan2(b,a2) * 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:
    l = 2*x/b/a
    print(math.atan(b/l)*180/math.pi)
else:
    l = 2*x/a/a-b
    print(math.atan((b-l)/a)*180/math.pi)

Submission status: Accepted

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

def ok(mid,a,b,x_s):
    x = a * math.sin(mid*math.pi/180)/math.sin(math.pi/2 - (mid * math.pi/180))
    s = 0
    if b - x > 0:
        s = (b - x + b)/2 * a
    else:
        x = b * math.sin(math.pi/2 - (mid * math.pi/180))/math.sin(mid*math.pi/180)
        s = 0.5 * x * b
    if s < x_s:
        return -1
    else:
        return 1

def bin_search(a,b,x):
    l = 0.0
    r = 90.0
    while abs(l - r) > 1e-10:
        mid = l + (r - l)/2
        res = ok(mid,a,b,x)
        if res < 0:
            r = mid
        else:
            l = mid
    return r


#def toFixed(numObj, digits=0):
#    return f"{numObj:.{digits}f}"


print(bin_search(a,b,x/a))

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque
import re
import math
import functools

def sRaw():
    return input().rstrip("\r")

def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29


def make1d_arr(n, val=INF):
    return [val for i in range(n)]


def make2d_arr(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]


def gcd(a, b):
    if(b == 0):
        return a
    return gcd(b, a % b)


def BFord(n,es):
    v_cost = [INF]*n
    v_cost[0] = 0
    for v in range(n*2):
        for e in es:
            frm = e[0]
            to = e[1]
            if v_cost[to] > v_cost[frm]+e[2]:
                v_cost[to] = v_cost[frm]+e[2]
                if v >= n:
                    v_cost[to] = -INF
        if v == n-1:
            prev = v_cost[:]
    v_cost = [-INF if prev[idx]!=v_cost[idx] else v_cost[idx] for idx in range(n)]
    return v_cost
    
def ZAlgo(s):
    l = len(s)
    A = [0]*l
    i =1
    j =0
    A[0]=l
    while i<l:
        while i+j<l and s[j] == s[i+j]:
            j+=1
        if j==0:
            i+=1
            continue
        A[i]=j
        k=1
        while (i+k<l) and (k+A[k]<j):
            A[i+k] =A[k]
            k+=1
        i+=k
        j-=k
    return A


def main():
    a,b,x = isRaw()
    half_theta = math.atan2(b,a)
    if x >= a*a*b/2:
        res = a*a*b-x
        return math.degrees(math.atan2(2*res,a*a*a))
    else:
        return math.degrees(math.atan2(a*b*b, 2*x))

if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
# 191027 D
import math
a,b,x = list(map(int,input().split()))
da = a * a
y = (2*x - da*b) / da
#print(y)
#print((b - y) / math.sqrt(a))
if y < 0:
    y = (2 * x) / (a * b)
    print(90 - math.degrees(math.atan(y/b)))
else:
    print(math.degrees(math.atan((b - y) / a)))

Submission status: Accepted

Solution code:
import numpy as np

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

if v/2 <= x:
    print(np.arctan(2*(v-x)/(a**3))*(180/np.pi))
else:
    print((np.pi/2 - np.arctan((2*x)/(a*b*b)))*(180/np.pi))

Submission status: Accepted

Solution code:
import math

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

a = int(a)
b = int(b)
x = int(x)

h = x/(a**2)

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

Submission status: Accepted

Solution code:
import math
cup = list(map(int, input().split()))
a = cup[0]
b = cup[1]
x = cup[2]
Area_x = x / a
if Area_x > a * b / 2:
    deg = math.degrees(math.atan((2 * b - 2 * Area_x / a) / a))
else:
    deg = math.degrees(math.atan((b**2 /(2 * Area_x))))
print(deg)

Submission status: Accepted

Solution code:
import math

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

epsilon = 1e-6
delta = 1.0
lim_sum = b * a / 2
lim_sum *= a
tmp_sum = 0.0
theta = 0.0
N = 1000

stop_count = 0

if x == lim_sum:
    #45度のとき
    print(float(45))
elif x > lim_sum:
    #45度未満のとき
    while True:
        stop_count += 1
        if theta < 0 or 90 < theta or stop_count == N:
            print('error')
            break
        tmp_sum = a*b - a*a*math.tan(math.radians(theta))/2.0
        tmp_sum *= a
        #print(theta, tmp_sum, x)
        if x - tmp_sum > 0:
            theta -= delta
            delta /= 2
            continue
        elif abs(x - tmp_sum) <= epsilon:
            print(theta)
            break
        theta += delta
elif x < lim_sum:
    #45度より大きいとき
    theta = 45.0
    while True:
        stop_count += 1
        if theta < 0 or 90 < theta or stop_count == N:
            print('error')
            break
        tmp_sum = b*b/math.tan(math.radians(theta))/2.0
        tmp_sum *= a
        #print(theta, tmp_sum, x)
        if x - tmp_sum > 0:
            theta -= delta
            delta /= 2
            continue
        elif abs(x - tmp_sum) <= epsilon:
            print(theta)
            break
        theta += delta

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import atan, degrees

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

D = a**2 * b / 2
S = x/a

if x == a ** 2 * b:
  deg = 90
  
elif x < D:
  Z = a - 2*S/b
  rad = atan((a-Z) / b)
  deg = degrees(rad)
  
elif x > D:
  Y = 2*S/a - b
  rad = atan(a / (b-Y))
  deg = degrees(rad)
  
else:
  rad = atan(a / b)
  deg = degrees(rad)

print(90-deg)

Submission status: Accepted

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

c = a*a*b/2
d = a*a*b-x
if d==0:
  print(0)
else:
  if x>c:
    e = ((d/a)*2)/a
    t = a/e
    print(90-math.degrees(math.atan(t)))
  else:
    f = ((x/a)*2)/b
    t = f/b
    print(90-math.degrees(math.atan(t)))

Submission status: Accepted

Solution code:
import os
import numpy as np

class getStdin(object):
    @classmethod
    def get_int(cls):
        return int(input())

    @classmethod
    def get_ss_int(cls):
        return list(map(float, input().split()))

    @classmethod
    def get_na_int(cls):
        return np.array(sorted(list(map(int, input().split()))))

    @classmethod
    def get_na_intr(cls):
        return np.array(sorted(list(map(int, input().split())))[::-1])


class funcCls(object):
    @classmethod
    def done(cls, a, b, x):
        import math
        mm = x / a
        if mm <= (a * b / 2):
            th = math.degrees(math.atan(b ** 2 / (2 * mm)))
        else:
            th = math.degrees(math.atan((-2*mm + 2*a*b) / a ** 2))

        return th


if __name__ == '__main__':
    a, b, x = getStdin.get_ss_int()
    y = funcCls.done(a, b, x)

    print(y)
    os.sys.exit(0)

Submission status: Accepted

Solution code:
import math
import os
import sys
from decimal import Decimal

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

A, B, X = list(map(Decimal, sys.stdin.readline().split()))

# 平面にする
X /= A
if X <= A * B / 2:
    # 半分より小さい
    ans = math.atan2(B, X * 2 / B) / math.pi * 180
    print(ans)
else:
    X = A * B - X
    ans = math.atan2(X * 2 / A, A) / math.pi * 180
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a, b, x = [ int(x) for x in input().split(' ') ]
low, high = 0, math.pi / 2
while (high - low) / math.pi * 180 > 1e-12:
    alpha = (low + high) / 2
    if alpha < math.atan(b/a):
        vol = a * (a * b - a * a * math.tan(alpha) / 2)
    else:
        vol = a * (b * b * math.tan(math.pi / 2 - alpha) / 2)
    if vol >= x:
        low = alpha
    else:
        high = alpha
print(low / math.pi * 180)

Submission status: Accepted

Solution code:
import math

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

y = x / a

if y <= a * b / 2:
  h = y * 2 / b
  t = math.degrees(math.atan(h / b))
  res = 90 - t
else:
  r = a * b - y
  h = r * 2 / a
  res = math.degrees(math.atan(h / a))

print(res)

Submission status: Accepted

Solution code:
from math import tan, atan, degrees, pi
error = 10**(-8)

def calc(th):
    if th > atan(a / b):
        return a**2 * b - a**3 / (2*tan(th))
    else:
        return a * b**2 * tan(th) / 2


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

left = 0.0
right = pi/2
while right - left > error:
    mid = (left + right) / 2
    if calc(mid) <= x: #まだこぼれてない
        left = mid
    else: #こぼれ始めている
        right = mid

ans = (left + right) / 2
print(90 - degrees(ans))

Submission status: Accepted

Solution code:
import math

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

max_volume = a*a*b
h = (x / max_volume) * b
if (b-h < h):
  theta = math.atan((b-h)/(a/2)) * 180 / math.pi
else:
  m = (2*x)/(a*b)
  theta = math.atan(b/m) * 180 / math.pi

print(theta)

Submission status: Accepted

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

if 2*x >= a*a*b:
    h = 2*(a*a*b-x)/(a*a)
    print(degrees(atan(h/a)))
else:
    l = 2*(a*a*b-x)/(a*b) - a
    print(degrees(atan(b/(a-l))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())
if x <= 0.5 * a*a*b:
    ans = math.pi / 2 - math.atan(2*x / (b*b*a))
    print(ans / (math.pi/ 4) * 45)
elif x == a * a *b:
    print(0)
else:
    ans = math.atan(a*a*a / (2*a*a*b - 2*x))
    print(90 - ans / (math.pi/ 4) * 45)

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    solve()

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:
import math

line = input().split()
a = int(line[0])
b = int(line[1])
x = int(line[2])

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

print(theta)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math

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

# solve
S = x / a
if (S >= (a * b) / 2):
    h = (a * b - S) * 2 / a
    rad = math.atan2(h, a)
else:
    w = S * 2 / b
    rad = math.atan2(b, w)

# output
print(rad / (2 * math.pi) * 360)

Submission status: Accepted

Solution code:
import numpy as np
import math
a,b,x=map(float,input().split())
if x==a*a*b:
    print(0)
    exit()
if x<=a*a*b/2:
    ans=x/a
else :
    ans=(a*a*b-x)/a
    b=ans*2.0/a
ans*=2.0
m=ans/b
ans=np.arctan2(b,m)
ans=ans/math.pi*180.0
print(ans)

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc144/tasks/abc144_d
import math
a, b, x = list(map(int,input().split()))
s = x/a
if s <= b*a/2:
    y = 2*s/b
    l = y**2/(math.sqrt(y**2 + b**2))
    print(math.degrees(math.acos(l/y)))
elif b*a/2 < s <= a*b:
    #(b+y)*a/2 = s
    y = (2*s)/a-b
    c = (s-a*y)*2/a
    print(math.degrees(math.atan(c/a)))

Submission status: Accepted

Solution code:
import math

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

if S >= x/a:
  change_length = 2*x/(a*b)
  rad = math.atan2(b, change_length)
else:
  change_length = (2*b - 2*x/(a**2))
  rad = math.atan2(change_length, a)
Theta = math.degrees(rad)
print('{:.10f}'.format(Theta))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
------------------------
author : iiou16
time : 11/01/12:15
------------------------
'''
import math


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

    if (x / (a * a)) >= b / 2:
        p = (2 * b) - (2 * x / (a * a))
        ans = 180 * math.atan2(p, a) / math.pi
    else:
        p = 2 * x / (a * b)
        ans = 180 * math.atan2(b, p) / math.pi
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

taiseki = a**2*b

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from decimal import Decimal
A, B ,X= map(int, input().split())
l=0
r=90
flag=0
pool=0

if X>=A*A*B/2:
    for i in range(100):
        k=math.tan(math.radians((r+l)/2))*A*A*A/2
        if A*A*B-k>=X:
            l=(r+l)/2
        else:
            r=(r+l)/2

    print(r)
else:
    for i in range(100):
        k = math.tan(math.radians(90-(r + l) / 2)) * B * B * A / 2
        if k>=X:
            l=(r+l)/2
        else:
            r=(r+l)/2
    print(r)

Submission status: Accepted

Solution code:
import math

a,b,x = list(map(int, input().strip().split()))
h = x/a/a
if h < b/2:
	aa = 2*x/a/b
	ans = math.atan2(aa, b) * 180 / math.pi
else:
	bb = 2*(a*a*b - x)/a/a
	ans = math.atan2(a, bb) * 180 / math.pi
print(90 - ans)

Submission status: Accepted

Solution code:
import math

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

answer = 0

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

Submission status: Accepted

Solution code:
import math

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

answer = 0

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

print(answer)

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:
# -*- coding: utf-8 -*-
a,b,x=map(int,input().split())
import math
if a*a*b/2>x:
    ans=math.atan((a*b*b)/(2*x))
    print(180*ans/math.pi)
else:
    ans=math.atan(2*(a*a*b-x)/(a**3))
    print(180*ans/math.pi)

Submission status: Accepted

Solution code:
import math

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

capacity = a * b

if x / a > capacity * 0.5:
    tan = 2 * (b / a - x / pow(a, 3)) 
    print(math.degrees(math.atan(tan)))
else:
    tan = 2 * x / (a * pow(b, 2))
    print(90 - math.degrees(math.atan(tan)))

Submission status: Accepted

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

side = x / a


if side <= a * b / 2:
    # only sankaku
    x = 2 * side / b
    rad = math.atan2(b, x)


else:
    y = (-2*side + 2* a*b)/a
    rad = math.atan2(y, a)


deg = math.degrees(rad)
print(deg)

Submission status: Accepted

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

if (a*a*b/2)<=x:
    s = (2*a*a*b-2*x)/(a**3)
else:
    s = (a*b*b)/(2*x)

import math
theta = math.degrees(math.atan(s))

print(theta)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

if a**2*b/2 <= x:
    z=S*2/(a**2)
    rad=np.arctan(z/a)
else:
    z=x*2/(a*b)
    rad=np.arctan(b/z)
print(np.rad2deg(rad))

Submission status: Accepted

Solution code:
import math

a, b, x=map(int, input().split())
ans=math.degrees(math.atan(2*(a*a*b-x)/a**3) if x>=a**2*b/2 else 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**2)*b/2:
  y=x/a*2/b
  print(' {:.10f}'.format(math.atan(b/y)/math.pi*180))
else:
  z=b*2-2*x/(a**2)
  print(' {:.10f}'.format(math.atan(z/a)/math.pi*180))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())
def pta(a, b, sita):
    return  a * b - ((a ** 2) * math.tan(math.radians(sita)) / 2)
def ptb(a, b, sita):
    return (b ** 2 * math.tan(math.radians(90-sita)) / 2)
max = 90
min = 0
for i in range(60):
    sen = (max + min) / 2

    if (a ** 2) * b / 2 >= x:
        #print("ptb", ptb(a, b, sen))
        if ptb(a, b, sen) >= x / a:
            min = sen
        else:
            max = sen
    else:
        #print("pta", pta(a, b, sen))
        if pta(a, b, sen) >= x / a:
            min = sen
        else:
            max = sen

print(sen)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math


def main():
  a, b, x = map(int, input().split())
  x = x / a
  low = 0
  high = 90

  for _ in range(100):
    r = (low + high) * 0.5
    rb = math.tan(r * math.pi / 180) * a
    ra = math.tan((90 - r) * math.pi / 180) * b

    if rb < b:
      y = a * b - a * rb * 0.5
    else:
      y = ra * b * 0.5

    if y > x:
      low = r
    else:
      high = r

  print((low + high) * 0.5)


if __name__ == '__main__':
  main()

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

Submission status: Accepted

Solution code:
from math import atan2, degrees


def solve(string):
    a, b, x = map(int, string.split())
    if x >= a**2 * b / 2:
        c, d = 2 * (a**2 * b - x), a**3
    else:
        c, d = a * b**2, 2 * x
    return str(degrees(atan2(c, d)))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

Solution code:
from math import atan2, pi


def solve(string):
    a, b, x = map(int, string.split())
    if x >= a**2 * b / 2:
        c, d = 2 * (a**2 * b - x), a**3
    else:
        c, d = a * b**2, 2 * x
    return str(atan2(c, d) * 180 / pi)


if __name__ == '__main__':
    print(solve(input()))