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())

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

Submission status: Accepted

Solution code:
import math

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

tan_theta = 0

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

elif x < a * a * b / 2:
    tan_theta = a * b * b / (2 * x)

else:
    tan_theta = b / a

print(math.degrees(math.atan(tan_theta)))

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
"""
import math


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

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

print(theta)
"""

from math import atan, pi

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

if x >= a * a * b / 2:
    print(atan((a*a*b-x)/(a*a*a/2))/(2 * pi)*360)
else:
    print(90 - atan(x/(a*b*b/2))/(2 * pi)*360)

Submission status: Accepted

Solution code:
import itertools
import math


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

    return a, b, x


def solve(a, b, x):
    tan = 0
    if a * a * b / 2 >= x:
        tan = a * b * b / (2 * x)
    else:
        tan = (2 * b * a * a - 2 * x) / (a ** 3)
    return math.degrees(math.atan(tan))


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def tan(deg):
    rad = deg * math.pi / 180.
    return math.tan(rad)

def calcDiff(a, b, angle, x):
    if tan(angle) > b / a:
        res = a*b*b/(2.* tan(angle))
    else:
        res = a*a*b - a*a*a*tan(angle) / 2.
    return res - x

def main():
    a, b, x = LI()
    ok = 0
    ng = 90
    diff = calcDiff(a, b, 0, x)
    while diff > 10**(-6) or diff < 0:
        m = (ok + ng) / 2.
        diff = calcDiff(a, b, m, x)
        if diff < 0:
            ng = m
        else:
            ok = m
    print(ok)

main()

Submission status: Accepted

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

    d = 2*h*a/b

    sin = math.degrees(math.acos(d/((d**2+b**2)**0.5)))
    print(sin)
else:
    d = 2*(b-h)*a/a
    sin = math.degrees(math.acos(d/((d**2+a**2)**0.5)))
    print(90-sin)

Submission status: Accepted

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

    d = 2*h*a/b

    sin = math.degrees(math.acos(d/((d**2+b**2)**0.5)))
    print(sin)
else:
    d = 2*(b-h)*a/a
    sin = math.degrees(math.acos(d/((d**2+a**2)**0.5)))
    print(90-sin)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if x <= a*a*b/2:
  print(math.degrees(math.asin(a*b*b/((b**4)*(a**2)+4*x*x)**0.5)))
else:
  print(math.degrees(math.asin((2*a*a*b-2*x)/(a**6+4*(a*a*b-x)**2)**0.5)))

Submission status: Accepted

Solution code:
import math
a,b,x = map(int,input().split())
half = (a * a * b) / 2
p=0
if x > half:
    t = 2 * b - 2 * x / (a*a)
    x1 = a
    y1 = t
    rad = math.atan2(y1, x1)
    p = math.degrees(rad)
elif x == half:
    x1 = a
    y1 = b
    rad = math.atan2(y1, x1)
    p = math.degrees(rad)
else:
    t = 2 * x / (a*b)
    x1 = t
    y1 = b
    rad = math.atan2(y1, x1)
    p = math.degrees(rad)
print(p)

Submission status: Accepted

Solution code:
import math

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)

import logging
import math

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


def resolve():
    a, b, x = [float(x) for x in sys.stdin.readline().split()]

    logger.debug([a, b, x])

    y_0 = 2 * x / a**2
    logger.debug(y_0)

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


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py
# pypy3 -m unittest template/template.py
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2 2 4"""
        output = """45.0000000000"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """12 21 10"""
        output = """89.7834636934"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """3 1 8"""
        output = """4.2363947991"""
        self.assertIO(input, output)

Submission status: Accepted

Solution code:
import numpy as np
a,b,x=[int(i) for i in input().split()]



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

Submission status: Accepted

Solution code:
import math


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

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

print(math.degrees(math.atan(t)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

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

print(theta)

Submission status: Accepted

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

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

Submission status: Accepted

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

x = x / a

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

Submission status: Accepted

Solution code:
# D
import numpy as np
a, b, x = map(int, input().split())
h = (x/(a*a)-0.5*b)/0.5
if h > 0.0:
    print("%.11f"%(np.arctan((b-h)/a)*180/np.pi))
else:
    h = x/(0.5*b*a)
    print("%.11f"%(np.arctan(b/h)*180/np.pi))

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math
from math import atan, cos, tan

a, b, x = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる

result =0

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

print(result)

Submission status: Accepted

Solution code:
import collections
import math
import operator as op
from functools import reduce

import numpy as np
import math


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

    print(angle)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

v = a*a*b
# 台形
if v/2 < x:
    c = (v - x) * 2 / (a ** 2)
    print(math.atan2(c, a)/math.pi*180)
# 三角形
else:
    c = x * 2 / (a*b)
    print(math.atan2(b, c)/math.pi*180)

Submission status: Accepted

Solution code:
import math
a, b, x = map(int,input().split())
#水筒に入る水の体積V
V = (a**2) * b
#平面に落とし込むと
S = x / a
#Sが三角形になる場合と台形になる場合に分ける
#満杯の場合(0除算をふせぐため)
if S == (a * b):
    ans = 0.0
    print(ans)
#三角形になる場合
elif S < (a*b/2):
    #三角形の高さa_dashを求める
    a_dash = S * 2 / b
    f = a_dash / b
    ans = math.degrees(math.atan(f))
    print(90.0 - ans)
#台形になる場合
else:
    #台形の上辺buの長さを求める
    bu =  (S*2)/a - b
    b_dash = b - bu
    #台形から三角形を切り抜く
    S_dash = S - (a*bu)
    f = a / b_dash
    ans = math.degrees(math.atan(f))
    print(90.0-ans)

Submission status: Accepted

Solution code:
import math
a, b, x = map(int,input().split())
#水筒に入る水の体積V
V = (a**2) * b
#平面に落とし込むと
S = x / a
#Sが三角形になる場合と台形になる場合に分ける
#三角形になる場合
if S == (a * b):
    ans = 0.0
    print(ans)

elif S < (a*b/2):
    #三角形の高さa_dashを求める
    a_dash = S * 2 / b
    f = a_dash / b
    ans = math.degrees(math.atan(f))
    print(90.0 - ans)
#台形になる場合
else:
    #台形の上辺buの長さを求める
    bu =  (S*2)/a - b
    b_dash = b - bu
    #台形から三角形を切り抜く
    S_dash = S - (a*bu)
    f = a / b_dash
    ans = math.degrees(math.atan(f))
    print(90.0-ans)

Submission status: Accepted

Solution code:
import math
a, b, x = map(int,input().split())
#水筒に入る水の体積V
V = (a**2) * b
#ans = 90.0 * (1.0 - x/V)
#xがVの半分以上の場合
if V / 2 <= x:
    f = 2*(V - x) / a ** 3
    print(math.degrees(math.atan(f)))
#xがVの半分以下の場合
else:
    f = 2*x / (b**2 * a)
    print(90 - math.degrees(math.atan(f)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())
if a*a*b/2 == x:
    # 丁度半分
    h=b
    w=a
elif a*a*b/2 > x:
    # 半分未満
    h=b
    w=2*x/b/a
else:
    # 半分越え
    h=2*(b-x/a/a)
    w=a
print(math.degrees(math.atan(h/w)))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
from math import atan,pi
def resolve():
    a,b,x=map(int,input().split())
    if(x<=a*a*b/2):
        print(atan((a*b*b)/(2*x))*180/pi)
    else:
        print(atan(2*(a*a*b-x)/(a**3))*180/pi)
resolve()

Submission status: Accepted

Solution code:
import sys
import math
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

def main():
	a, b, x = MAP()
	c = x / (a**2)
	if c >= b/2:
		d = 2*b - 2*c
		#print(c, d)
		ans = math.degrees(math.atan(d/a))
		print(ans)
	else:
		e = 2*a*c/b
		tana = math.degrees(math.atan(e/b))
		ans = 90 - tana
		print(ans)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
import math

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


l = x/(a*a)

if l<=b/2.0:
    f = b**2.0/(2.0*a*l)
else:
    f = 2.0*(b-l)/a
ans = math.degrees(math.atan(f))
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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


l = x/(a*a)

if l<=b/2.0:
    f = b**2.0/(2.0*a*l)
else:
    f = 2.0*(b-l)/a
ans = np.rad2deg(np.arctan(f))
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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


l = x/(a*a)

if l<=b/2.0:
    ans = np.rad2deg(np.arctan(b**2.0/(2.0*a*l)))
else:
    ans = np.rad2deg(np.arctan(2.0*(b-l)/a))

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

'''実はarctanは実装されていた...
def search_arctan(tan):
    low = 0
    high = np.radians(90)
    while (high-low>=10**(-12)):
        mid = (low+high)/2 
        if np.tan(mid)<=tan:
            low = mid
        else:
            high = mid
    return np.rad2deg(mid)
'''
a,b,x = list(map(int,input().split()))


l = x/(a*a)

if l<=b/2.0:
    ans = np.rad2deg(np.arctan(b**2.0/(2.0*a*l)))
else:
    ans = np.rad2deg(np.arctan(2.0*(b-l)/a))

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

def search_arctan(tan):
    low = 0
    high = np.radians(90)
    while (high-low>=10**(-12)):
        mid = (low+high)/2 
        if np.tan(mid)<=tan:
            low = mid
        else:
            high = mid
    return np.rad2deg(mid)

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

l = x/(a*a)

if l<=b/2.0:
    ans = search_arctan(b**2.0/(2.0*a*l))
else:
    ans = search_arctan(2.0*(b-l)/a)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def run():
  a, b, x = map(int, input().split())
  if a**2*b/2 > x:
    tan = 2*x/(a*b**2)
    print(90-math.degrees(math.atan(tan)))
  else:
    tan = 2*(a**2*b-x)/(a**3)
    print(math.degrees(math.atan(tan)))
  
if __name__ == '__main__':
  run()

Submission status: Accepted

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


def solve(a: int, b: int, x: int):
    h = 2 * (b - (x / (a*a)))
    if b < h:
        h = b
        a = 2 * (x / (a*b))
    print(math.degrees(math.atan(h / a)))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    x = int(next(tokens))  # type: int
    solve(a, b, x)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

    xdash = x / a
    FULL = a * b

    if xdash == FULL:
        return 0
    elif FULL / 2 == xdash:
        return b/a
    elif FULL / 2 > xdash:
        return b*b/xdash/2
    else:
        return 2*(a*b-xdash)/a/a

print(math.degrees(math.atan(h())))

Submission status: Accepted

Solution code:
import math

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

xdash = x / a
FULL = a * b

if xdash == FULL:
    print(0)
elif FULL / 2 == xdash:
    print(math.degrees(math.atan2(b,a)))
elif FULL / 2 > xdash:
    print(90-math.degrees(math.atan(2*xdash/b/b)))
else:
    print(90-math.degrees(math.atan(a*a/2/(a*b-xdash))))

Submission status: Accepted

Solution code:

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

print(degrees(ans))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
from math import degrees, atan, pi


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

if x >= (a ** 2) * b / 2:
    t = 2 / (a ** 3) * (b * a ** 2 - x)
    theta = atan(t)
else:
    theta = pi / 2 - atan((2 * x) / (a * b ** 2))

print(degrees(theta))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def f(a,b,x):
    theta = 0
    v = a * a * b / 2
    if x <= v:
        theta = math.degrees(math.atan((a * b * b / 2)/x))
        print(theta)
    else:
        theta = math.degrees(math.atan((2 * b -(2 * x /(a * a))) / a))
        print(theta)

f(a,b,x)

Submission status: Accepted

Solution code:
import math

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

h = x/a

if h >= b/2:
    d = math.atan(2*(b-h)/a)
    ans = math.degrees(d)

else:
    d = math.atan(2*x/b/b)
    ans = 90-math.degrees(d)

print(ans)

Submission status: Accepted

Solution code:
import math

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

    if (x / a) > (a * b) / 2:
        h = (2/a) * ((a*b) - (x/a))
        r = math.atan2(h, a)
    else:
        area = x / a
        h = (2 * area) / b
        r = math.atan2(b, h)

    ans = r * 180 / math.pi
    print(ans)



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import itertools
import bisect
import math
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

a, b, x = na()
d = x / (a * a)
if 2 * d < b:
    angle = math.atan(b / (2 * a * d / b)) * (180 / math.pi)
else:
    angle = math.atan(2 * (b - d) / a) * (180 / math.pi)
if angle < 0:
    angle += 180
if angle > 180:
    angle -= 180
print(angle)

Submission status: Accepted

Solution code:
import sys
from math import atan, degrees, pi

[astr, bstr, cstr] = sys.stdin.readline().split(" ")
a = float(astr)
b = float(bstr)
x = float(cstr)

theta = float(0)
threshold = a * a * b / 2

if threshold < x:  # 角より上
    theta = (2 * (a * a * b - x)) / (a*a*a)
else:
    theta = (a * b * b) / x / 2

rad = atan(theta)
print(degrees(rad))

Submission status: Accepted

Solution code:
data = [int(x) for x in input().split()]
a = data[0]
b = data[1]
x = data[2]
v = a*a*b
import math
if x <= v/2:
  tan = 2*x/(a*b*b)
  w = math.atan(tan)
  t = 90 - math.degrees(w)
else:
  y = v - x
  tan = 2*y/(a*a*a)
  w = math.atan(tan)
  t = math.degrees(w)
print(t)

Submission status: Accepted

Solution code:
from math import atan2, pi

a, b, x = map(int, input().split())
V = a * a * b
p2t = 180 / pi
if V == x:
    print(0)
elif V/2 < x:
    # print(p2t*tan(a**3/(2*(V-x))))
    print(90-p2t*atan2(a, 2*(V-x)/a**2))
else:
    # print(p2t*tan(a**3/(2*x)))
    print(90-p2t*atan2(2*x/a/b, b))

Submission status: Accepted

Solution code:
import math


def calc(a, b, theta):
    if a * math.tan(math.radians(theta)) <= b:
        return a * a * b - a * a * a * math.tan(math.radians(theta)) / 2
    else:
        return b * b / math.tan(math.radians(theta)) * a / 2


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

    ok = 90
    ng = 0
    for _ in range(1000):
        mid = (ok + ng) / 2
        if calc(a, b, mid) < x:
            ok = mid
        else:
            ng = mid

    print(ok)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import math

EPS = 0.0000000001


def calc(a, b, theta):
    if a * math.tan(math.radians(theta)) <= b:
        return a * a * b - a * a * a * math.tan(math.radians(theta)) / 2
    else:
        return b * b / math.tan(math.radians(theta)) * a / 2


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

    ok = 90
    ng = 0
    for _ in range(1000):
        mid = (ok + ng) / 2
        if calc(a, b, mid) < x:
            ok = mid
        else:
            ng = mid

    print(ok)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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


if __name__ == '__main__':
    main()

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
    rad = math.atan2(h,a)
else:
    w = 2*S/b
    rad = math.atan2(b,w)
deg = rad/(2*math.pi)*360
print(deg)

Submission status: Accepted

Solution code:

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

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

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
    rad = math.atan2(h, a)
else:
    w = s * 2 / b
    rad = math.atan2(b, w)

print(math.degrees(rad))

Submission status: Accepted

Solution code:
from math import tan, pi

a, b, x = list(map(float, input().split()))
eps = 1e-9

def f(a, b, theta):
    if theta > pi / 2.0 - eps:
        return  0.0
    ret = 0.0
    if a * tan(theta) <= b:
        ret = a * a * b - a * a * a * tan(theta) / 2.0
    else:
        ret = b * b / tan(theta) * a / 2.0
    return ret

def solve():
    ok = pi / 2.0
    ng = 0.0
    for _ in range(100000):
        mid = (ok + ng) / 2.0
        if f(a, b, mid) < x:
            ok = mid
        else:
            ng = mid
    print("{:.10f}".format(ok / pi * 180))

solve()

Submission status: Accepted

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 ** -7 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: Accepted

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

if x<a**2*b/2:
    theta=np.arctan2(a*b**2,2*x)
else:
    theta=np.arctan2(2*b-2*x/a**2,a)

print(math.degrees(theta))

Submission status: Accepted

Solution code:
from math import tan, radians

def water(a, b, t):
    if a * tan(radians(t)) < b:
        water = a*a*b - a*a*a*tan(radians(t))*0.5
        
    else:
        water = 0.5 * b * b*tan(radians(90 - t)) * a
    
    return water    


def main():
    a, b, x = map(int, input().split())
    min = 0
    max = 90
    for _ in range(10000):
        tmp = (min + max) / 2
        if water(a, b, tmp) < x:
            max = tmp
        else:
            min = tmp
    print(min)

if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

print(math.degrees(math.atan(ta)))

Submission status: Accepted

Solution code:
def main():
    import math
    a, b ,x = [int(x) for x in input().split()]

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

    else:
        theta = math.atan(a*b*b/2/x)

    print(math.degrees(theta))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    a, b, x = [int(x) for x in input().split()]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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(10000):
        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)