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())
s = x / a
if s >= (a * b) / 2:
    y, x = 2*(a*b - s) / a, a
else:
    y, x = b, 2*s / b
print(math.degrees(math.atan2(y, x)))

Submission status: Accepted

Solution code:
import math

def f(theta):
    theta = math.radians(theta)
    if x > a * b / 2:
        return a * b - a * a * math.tan(theta) / 2
    else:
        return b * b / (2 * math.tan(theta))
        
a, b, x = map(int, input().split())
x /= a

left = 0
right = 90
for i in range(40):
    theta = (left + right) / 2
    
    if f(theta) > x:
        left = theta
    else:
        right = theta
print(theta)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
from math import atan
from math import degrees

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

Submission status: Accepted

Solution code:
import math

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

s = x / a

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)
ans = math.degrees(radian)
print(ans)

Submission status: Accepted

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

# 空いている空間の体積
emp = a*a*b - x
# 空いた空間の三角柱の辺のうち、傾けて長さが変動する一辺の長さ
t_length = (emp * 2) / (a*a)

# 水が入った部分が三角柱型になる時は上の処理、空いた空間が三角柱型であるうちは下の処理、
if t_length > b:
    print(90 - math.degrees(math.atan2((x*2) / (a*b), b)))
else:
    print(math.degrees(math.atan2(t_length, a)))

Submission status: Accepted

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

# 空いている空間の体積
emp = a*a*b - x
# 空いた空間の三角柱の辺のうち、傾けて長さが変動する一辺の長さ
t_length = (emp * 2) / (a*a)

# 水が入った部分が三角柱型になる時は上の処理、空いた空間が三角柱型であるうちは下の処理、
if t_length >= b:
    print(90 - math.degrees(math.atan2((x*2) / (a*b), b)))
else:
    print(math.degrees(math.atan2(t_length, a)))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b, x = map(int, input().split())
    s = a * (x / pow(a, 2))

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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import math

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

v = a*a*b

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

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

trapezoid = a * b * a / 2

def trapezoid_v(theta):
  t = math.tan(theta)
  an = a * t
  return b * a * a - a * an * a / 2

def triangle_v(theta):
  t = math.tan(math.pi/2 - theta)
  an = b * t
  return an * b * a / 2

def bin_s(l, u):
  theta = (l + u) / 2

  t = math.tan(theta)
  an = a * t
  if an < b:
    volume_func = trapezoid_v
  else:
    volume_func = triangle_v

  v = volume_func(theta)

  if abs(v-x) < 10**(-6):
    return theta
  elif v > x:
    return bin_s((l+u)/2, u)
  elif v < x:
    return bin_s(l, (l+u)/2)
  else:
    return theta
print(math.degrees(bin_s(0, math.pi/2)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


def resolve():
    a, b, x = map(int, input().split())
    s = x / a

    if s <= a * b / 2:
        rad = math.atan(b / (2 * s / b))
    else:
        rad = math.atan(2 * (a * b - s) / a**2)

    print(rad * 180 / math.pi)

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    a, b, x = LI()

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import math

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

"""
a<=100
b<=100
x<=a**2*b

角度y傾けた時の空白の体積を求めれば良い
"""

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

Submission status: Accepted

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

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

if 2*x >= a*a*b:
    tan_theta = 2*(b*a*a-x)/(a*a*a)
else:
    tan_theta = a*b*b/(2*x)

print(math.atan(tan_theta)/math.pi*180)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
a, b, x  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()


def f(a, b, x):
    """
    """
    if a * a * b / 2 <= x:
        return math.atan(2 * (a * a * b - x) / (a * a * a))
    else:
        return math.pi / 2 - math.atan(2 * x / (a * b * b))

#print(f(a, b, x) * 180 / math.pi)
print(math.degrees(f(a, b, x)))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
a, b, x  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()


def f(a, b, x):
    if a * a * b / 2 <= x:
        return math.atan(2 * (a * a * b - x) / (a * a * a))
    else:
        return math.pi / 2 - math.atan(2 * x / (a * b * b))

print(f(a, b, x) * 180 / math.pi)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math
a, b, x = map(int, input().split())
V = a*a*b

if V/2 >= x: # 三角形
    c = 2 * x / a / b
    print(math.degrees(math.atan2(b,c)))
else: # 台形
    c = 2 * (V-x) / a / a
    print(math.degrees(math.atan2(c,a)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit
import math


def main():
    input = stdin.buffer.readline
    a, b, x = map(int, input().split())
    v = (a ** 2) * b

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


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

import math

if 2*Z>=A*A*B:
    theta = math.atan2(2*(B-Z/(A**2))/A,1)
    print(math.degrees(theta))
else:
    theta = math.atan2(B,2*Z/(A*B))
    print(math.degrees(theta))

Submission status: Accepted

Solution code:
import math
a,b,x = map(int,input().split())
if 2*x <= a**2*b: #45度以上
    h = 2*x/(a*b)
    tan = b/h
    sita = math.atan(tan)
    print(360*sita/(2*math.pi))
else: #ちょっと傾けたらこぼれる
    tan = (b-(x/a**2))*2/a
    sita = math.atan(tan)
    print(360*sita/(2*math.pi))

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())
ans=0
flag=False
if x==a*a*b/2:
  ans=a/b
elif x<a*a*b/2:
  t=a-2*x/(a*b)
  ans=(a-t)/b
else:
  t=2*x/(a**2)-b
  if (b-t)!=0:
    ans=a/(b-t)
  else:
    flag=True
if flag==False:
  print(90-math.degrees(math.atan(ans)))
else:
  print(0)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


a, b, x = MAP()

y = 2*x/a/b
h = x/a**2
left = b-h

if x <= a*a*b/2:
	print(degrees(atan(b/y)))
else:
	print(degrees(atan(2*left/a)))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 


a, b, x = MAP()

S = x/a        #水の断面積

if a*b/2 >= S:  #水の断面：三角形
	c = 2*S/b
	ans = degrees(atan(b/c))

else:           #水の断面：台形
	c = 2*S/a - b
	ans = degrees(atan((b-c)/a))

print(ans)

Submission status: Accepted

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

sys.setrecursionlimit(10 ** 8)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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


def solve():
    if 2 * x > a * a * b:
        return math.atan(2.0 * (b / a - x / (a * a * a)))
    else:
        return math.atan(0.5 * a * b * b / x)


if __name__ == "__main__":
    print(solve() / math.pi * 180.0)

Submission status: Accepted

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

sys.setrecursionlimit(10 ** 8)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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


def check1(rad):
    return a * math.tan(rad) <= (b - xda2) * 2


def check2(rad):
    return a * b * b >= x * math.tan(rad) * 2


def solve():
    check = check1 if 2 * x > a * a * b else check2
    ok, ng = 0.0, math.pi / 2.0
    eps = 1e-12
    while ng - ok > eps:
        m = (ng + ok) / 2.0
        if check(m):
            ok = m
        else:
            ng = m
    return ok


if __name__ == "__main__":
    print(solve() / math.pi * 180.0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

if area<=a*b/2.0:
    h=2*area/b
    print(90-np.degrees(np.arctan(h/b)))
else:
    h=2*b-2*area/a
    print(np.degrees(np.arctan(h/a)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

if x > a * a * b / 2:
    # 溢れるとき水の形が台形になってる
    # 溢れるときの台形の辺の長さ
    c = 2 * x / a ** 2 - b
    cos = (b - c) / math.sqrt((b - c) ** 2 + a ** 2)
    print(90 - math.degrees(math.acos(cos)))
else:
    # 溢れるとき水の形が三角形になってる
    # 溢れるときの底辺
    c = (x * 2) / a / b
    # print(c)
    cos = c / math.sqrt(c ** 2 + b ** 2)
    # print(cos)
    print(math.degrees(math.acos(cos)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import atan
from math import degrees

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

Submission status: Accepted

Solution code:
import math

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

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

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

Submission status: Accepted

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

import math

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

Submission status: Accepted

Solution code:
import math
a,b,x = map(int, input().split())
if x == a*a*b:
  print(0)
elif x >= a*a*b/2:
  print(math.atan((2*a*a*b-2*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 math

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
a, b, x = [int(x) for x in stdin.readline().rstrip().split()]
if b*a*a/2 > x:
    temp1 = 2*x/(a*b**2)
    print(90-math.degrees(math.atan(temp1)))
else:
    temp = (2*b*a*a-2*x)/(a**3)
    print(math.degrees(math.atan(temp)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def main():
    a, b, x = map(int, input().split())
    if(x <= (a * a * b) / 2): 
        tan_th = (a * b * b) / (2 * x)
    else:
        tan_th = (2 * (a * a * b - x)) / (a * a * a)
    ans = math.degrees(math.atan(tan_th))
    print(ans)
    return 0
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# D - Water Bottle

from math import atan, pi

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

theta = 0
if a * a * b / 2 < x:
    theta = atan((2 * ((a ** 2) * b - x)) / (a ** 3))
else:
    theta = atan((a * (b ** 2)) / (2 * x))

print(theta * 180 / pi)

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())
s=2*x/a**2
s_=s-b
if 0<=s_<b:
  print(90-360/2/math.pi*math.atan(a/(b-s_)))
elif s_==b:
  print(0)
else:
  u=2*x/a/b
  print(90-360/2/math.pi*math.atan(u/b))

Submission status: Accepted

Solution code:
import math

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

V = a*a*b

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc144/tasks/abc144_d

import math

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

w_max = a * a * b

# 対角線の水量
w_middle = w_max / 2

degree = 0

# 対角線以下の水量の時
if x <= w_middle:
    degree = math.degrees(math.atan((a*(b**2)) / (2*x)))

else:
    degree = math.degrees(math.atan(((w_max - x)*2) / (a**3)))

print(degree)

Submission status: Accepted

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

#theta = arctan(b/a)
half_area=a*b/2
if x==half_area:
    print(45)
if x<half_area:
    c = 2*x/b/b
    print(90-math.degrees(math.atan(c)))
if x>half_area:
    c = 2*(a*b-x)/a/a
    print(math.degrees(math.atan(c)))

Submission status: Accepted

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

Submission status: Accepted

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

if x <= a * a * (b / 2):
    c = 2 * x / (a * b)
    print(np.rad2deg(np.arctan(b / c)))
else:
    c = 2 * (a**2 * b - x) / a**2
    print(np.rad2deg(np.arctan(c / a)))

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

Submission status: Accepted

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

x = x/a

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

print(math.degrees(theta))

Submission status: Accepted

Solution code:
from math import pi, tan
EPS = 0.0000000001

def f(a, b, theta):
    if theta >= pi * 0.5:
        return 0.0
    elif tan(theta) >= b / a:
        return a * b**2 * 0.5 / tan(theta)
    else:
        return a**2 * b - a**3 * 0.5 * tan(theta)

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

l = 0
r = pi * 0.5
while r - l >= EPS:
    mid = (l + r) * 0.5
    if f(a, b, mid) >= x:
        l = mid
    else:
        r = mid

print("{:.10f}".format(l / pi * 180))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''fujioka_1115
底面がa*a、高さがbの直方体の容器に水がx入っている。
水を溢れさせずに容器を（正方形の1辺を軸として）傾けるとき、
最大で何度傾けられるか？　⇒絵を描いて考える。
底面が正方形なので、3次元ではなく、2次元で考える。
立体的に3次元としての水の体積xではなく、
横から2次元として見た水の面積x/aで考える。
奥行であるaで割って、2次元とする。なるべく、シンプルに考える。
x/a=(a*b)/2の時に、水面は容器の角にある。面積は三角形。
傾けた時、水面が側面にある場合(水の面積が台形)と
底面にある場合(水の面積が三角形)で場合分け。
つまり、水量xと容器の形状から求められる(a^2b)/2の大小で場合分け。
tanの逆関数がarctanを使う。
仰角Θ=arctan(対辺/底辺)
'''
import math
a,b,x=[int(s) for s in input().split()]
if x>a*a*b/2:#上記の場合分け
#水が多いので、傾けた側の反対側で水面が側面に接している。
  h=2*(a*a*b-x)/(a*a)
  print(math.degrees(math.atan(h/a)))#弧度法から角度へ変換する
else:
#水が少ないので、傾けた側面に隣接する底面に水面が接している。
  k=2*x/(a*b)
  print(math.degrees(math.atan(b/k)))

Submission status: Accepted

Solution code:
'''fujioka_1115
底面がa×a、高さがbの直方体の容器に水がx入っている。
水を溢れさせずに容器を（正方形の1辺を軸として）傾けるとき、
最大で何度傾けられるか？　⇒絵を描いて考える。
底面が正方形なので、3次元ではなく、2次元で考える。
水の量xではなく、横から2次元で見た面積x/aで考える。
奥行であるaで割って、2次元とする。なるべく、シンプルに考える。
x/a=(a*b)/2の時に、水面は容器の角にある。
傾けた時、水面が側面にある場合と底面にある場合で場合分け。
水量xと容器の形状から求められる(a^2b)/2の大小で場合分け。
tanの逆関数がarctanを使う。
仰角Θ=arctan(対辺/底辺)
'''
import math
a,b,x=[int(s) for s in input().split()]
if x>a*a*b/2:#上記の場合分け
#水が多いので、傾けた側の反対側で水面が側面に接している。
  h=2*(a*a*b-x)/(a*a)
  print(math.degrees(math.atan(h/a)))
else:
#水が多いので、傾けた側と別の水面が底面に接している。
  k=2*x/(a*b)
  print(math.degrees(math.atan(b/k)))

Submission status: Accepted

Solution code:
from math import pi, atan

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

if a**2 * b * 0.5 <= x:
    theta = atan(2 * (a**2 * b - x) / a**3)
else:
    theta = atan(a * b**2 * 0.5 / x)

print("{:.10f}".format(theta / pi * 180))

Submission status: Accepted

Solution code:
from math import pi, tan
EPS = 0.0000000001

def f(a, b, theta):
    if theta > pi * 0.5 - EPS:
        ret = 0.0
    elif a * tan(theta) <= b:
        ret = a**2 * b - a**3 * tan(theta) * 0.5
    else:
        ret = a * b**2 * 0.5 / tan(theta)

    return ret

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

ok = pi * 0.5
ng = 0.0
while ok - ng >= EPS:
    mid = (ok + ng) * 0.5
    if f(a, b, mid) < x:
        ok = mid
    else:
        ng = mid
print("{:.10f}".format(ok / pi * 180))

Submission status: Accepted

Solution code:
from math import pi, sin, cos, tan
EPS = 0.0000000001

def f(a, b, theta):
    if theta > pi * 0.5 - EPS:
        ret = 0.0
    elif a * tan(theta) <= b:
        ret = a**2 * b - a**3 * tan(theta) * 0.5
    else:
        ret = a * b**2 * 0.5 / tan(theta)

    return ret

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

ok = pi * 0.5
ng = 0.0
while ok - ng >= EPS:
    mid = (ok + ng) * 0.5
    if f(a, b, mid) < x:
        ok = mid
    else:
        ng = mid
print("{:.10f}".format(ok / pi * 180))

Submission status: Accepted

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

Submission status: Accepted

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

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


l = 0
r = math.pi/2
v = 0
while abs(v-x) > 0.0000001:
    mid = (r+l)/2
    if b*math.tan(math.pi/2 - mid) < a:
        v = b * b*math.tan(math.pi/2 - mid)/2*a
    else:
        v = (b*a - a*a/(math.tan(math.pi/2 - mid))/2)*a

    if x < v:
        l = mid
    else:
        r = mid

    #print(v,mid*180/math.pi)
print(mid*180/math.pi)

Submission status: Accepted

Solution code:
import math
def main():
    a, b, x = (int(_) for _ in input().split())
    if 2*x <= pow(a, 2) * b:
        print(math.degrees(math.atan(a * pow(b, 2) / 2 / x)))
    else:
        print(math.degrees(math.atan(2 * (pow(a, 2) * b - x) / pow(a, 3))))
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math


def main():
    a, b, x = list(map(int, input().split(' ')))
    side_area = x / a
    if side_area > a * b / 2:
        blank_side_area = a * b - side_area
        blank_side_edge = 2 * blank_side_area / a
        angle_rad = math.atan(blank_side_edge / a)
    else:
        bottom_edge = 2 * side_area / b
        angle_rad = math.atan(b / bottom_edge)
    angle_deg = 360 * angle_rad / (2 * math.pi)
    print(angle_deg)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

import math
ans=math.degrees(math.atan(tan))

print(ans)

Submission status: Accepted

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

import math

# ans =math.degrees(math.atan(a*(b**2)/(2*x)))
h = x/a**2


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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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