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:
from math import atan2, pi
a, b, x = map(int, input().split())
t = b - x / a / a
if 2 * t <= b:
    print(atan2(2 * t, a) * 180 / pi)
else:
    t = x / b / a
    print(atan2(b, 2 * t) * 180 / pi)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

A, B, X = getNM()

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

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

def tan(angle):
    return math.tan(math.radians(angle))

left = 0
right = 90

for _ in range(100):
    mid = (left + right) / 2
    res = 0
    if 2 * X >= (A ** 2) * B:
        res = small_tlit(A, B, X)
    else:
        res = big_tlit(A, B, X)

    if tan(mid) <= res:
        left = mid
    else:
        right = mid
print(right)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

print(180*t/math.pi)

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())
v = a * b
x = x / a
if x < v/2:
    c = x * 2 / b
    d = math.sqrt(b * b + c * c)
    print(math.degrees(math.asin(b/d)))
else:
    rest = v - x
    c = rest * 2 / a
    d = math.sqrt(a * a + c * c)
    print(math.degrees(math.acos(a/d)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
D - Water Bottle
https://atcoder.jp/contests/abc144/tasks/abc144_d

"""
import sys


from math import tan, radians, pi

def is_ok(a, b, x, d):
    if b * tan(pi/2 - radians(d)) <= a:
        return (b * b * tan(pi/2 - radians(d)) * a) / 2 >= x
    else:
        return a * a * (b - a * tan(radians(d))) + (a * a * a * tan(radians(d))) / 2 >= x


def solve(a, b, x):
    lb, ub = 0.0, 90.0
    for _ in range(100):
        mid = (lb + ub) / 2
        if is_ok(a, b, x, mid):
            lb = mid
        else:
            ub = mid
    return (lb + ub) / 2


def main(args):
    a, b, x = map(int, input().split())
    ans = solve(a, b, x)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
D - Water Bottle
https://atcoder.jp/contests/abc144/tasks/abc144_d

"""
import sys


from math import tan, radians, pi

def is_ok(a, b, x, d):
    if b * tan(pi/2 - radians(d)) <= a:
        return (b * b * tan(pi/2 - radians(d)) * a) / 2 >= x
    else:
        return a * a * (b - a * tan(radians(d))) + (a * a * a * tan(radians(d))) / 2 >= x


def solve(a, b, x):
    lb, ub = 0.0, 90.0
    for _ in range(100):
        mid = (lb + ub) / 2
        if is_ok(a, b, x, mid):
            lb = mid
        else:
            ub = mid
    return (lb + mid) / 2


def main(args):
    a, b, x = map(int, input().split())
    ans = solve(a, b, x)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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


if x > a*a*b/2:
  ｘ = x /(a*a)*2
  ok = 0
  ng = 90
  while ng-ok > 10**(-7):
    y = (ok + ng) /2
    if x/2 + a*math.tan(math.radians(y))/2 > b:
      ng = y
    else:
      ok = y
  print(ng)
else:
  x = x/a
  ok = 0
  ng = 90
  while ng-ok > 10**(-7):
    y = (ok + ng) /2
    if x*2/b * math.tan(math.radians(y)) > b:
      ng = y
    else:
      ok = y
  print(ng)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a, b, x = map(int, input().split())
A, B = a**2, b**2
print(math.degrees(math.asin((B / ((2 * x / (a * b))**2 + B))**0.5) if 2 * x <=
                   a * a * b else math.acos((A / ((2 * (a * a * b - x) / A)**2 + A))**0.5)))

Submission status: Accepted

Solution code:
from collections import Counter
from functools import reduce
from math import sin, cos, pi, radians
a, b, x = map(int, input().split())
error = 10**-10
x /= a

def f(deg):
    rad = radians(deg)

    r_height = b * sin(pi/2 - rad)
    l_height = a * sin(rad)
    if r_height <= l_height:
        ceil = b / sin(rad)
        s = ceil*r_height/2
    else:
        floor = a / cos(rad)
        height = a * sin(rad)
        s = a * b - floor*height/2

    return s

l = 0
r = 90
while True:
    mid = (l + r) / 2
    s = f(mid)
    if abs(x - s) <= error:
        break
    elif s > x:
        l = mid
    else:
        r = mid

print(mid)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())
A,B=a**2,b**2
print(math.degrees(math.asin((B/((2*x/(a*b))**2+B))**0.5) if 2*x<=a*a*b else math.acos((A/((2*(a*a*b-x)/A)**2+A))**0.5)))

Submission status: Accepted

Solution code:
from math import atan2, degrees
A, B, X = map(int, input().split())
S = X / A


if S >= A * B / 2:
    h = (2 * (A * B - S)) / A
    print(degrees(atan2(h, A)))

else:
    w = (2 * S) / B
    print(degrees(atan2(B, w)))

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

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

cap = a * a * b

h = (x / cap) * b
if h / b >= 0.5:
    gap = b - h
    print(math.degrees(math.atan((gap / (a / 2)))))
else:
    vol = h * a
    gap = (vol / b) * 2
    print(math.degrees(math.atan(b / gap)))

Submission status: Accepted

Solution code:
import math

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

if 2 * x > V:
  y = V - x
  r = r = (2 * y) /(a**3)
else:
  y = x
  r = (a * b**2) / (2 * y) 

theta = float(math.degrees(math.atan(r)))

print(theta)

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:
import numpy as np
a, b, x = map(int, input().split())
ans = 0
if (a*a*b/2) <= x:
    ans = np.rad2deg(np.arctan((2*(a*a*b-x))/(a*a*a)))
else:
    ans = np.rad2deg(np.arctan((a*b*b)/(2*x)))
print('{:.10f}'.format(ans))

Submission status: Accepted

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

import math

theta1 = math.atan((b - x/a**2)*2/a)
theta2 = math.atan((a*b**2/(2*x)))
if b < a*math.tan(theta2):
    theta = theta2
else:
    theta = theta1

print(math.degrees(theta))

Submission status: Accepted

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

if x >= a**2*b/2:  # けっっこうおおめ
    print(degrees(atan(2*(a**2*b-x)/a**3) ))
elif x < a**2*b/2:  # すっくねえ
    print(degrees(atan(b**2*a/(2*x))))

Submission status: Accepted

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

elif x < a**2 * b/2:
    print(degrees(atan(b**2*a/(2*x))))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

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


print('{:.7f}'.format(theta))

Submission status: Accepted

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

if x >= a**2*b/2:
    print(degrees(atan(2*(a**2*b-x)/a**3) ))
elif x < a**2*b/2:
    print(degrees(atan(b**2*a/(2*x))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())
c=b-(x/(a*a))
k=math.sqrt(c**2+(a*a/4))
if x<=a*a*b/2:
  o=(x*2/b)/a
  k=math.sqrt(o**2+b*b)
  print(math.degrees(math.acos(o/k)))
else:
  print(math.degrees(math.acos(a/(2*k))))

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
from collections import Counter,deque,defaultdict
# import itertools
import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
a,b,x=n1()

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

Submission status: Accepted

Solution code:
a,b,x = map(int,input().split())
x /= a
import math
PI = math.pi
if x > a*b//2:
    print("{:.10}".format(math.atan2((a*b-x)*2, a*a)*180/PI))
else:
    print("{:.10}".format(math.atan2(b*b,x*2)*180/PI))

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
a, b, x = list(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 ** 2) / (2 * x))))

Submission status: Accepted

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

if a**2 * b <= 2 * x:
    h = (a**2 * b - x) / a**2 * 2
    theta = h / (a**2 + h**2)**0.5
    ans = math.degrees(math.asin(theta))
else:
    h = 2 * x / a / b
    theta = h / (b**2 + h**2)**0.5
    ans = math.degrees(math.acos(theta))

print(ans)

Submission status: Accepted

Solution code:
import math
import numpy as np
pi = math.pi

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
input = sys.stdin.readline
input = sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode('utf-8')

#2325
#import numpy as np
import math

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

	k=0

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

	print(math.degrees(math.atan(k)))





if __name__ == "__main__":
	main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a,b,x=map(int,input().split())
A,B=a**2,b**2
print(math.degrees(math.asin((B/((2*x/(a*b))**2+B))**0.5) if 2*x<=a*a*b else math.acos((A/((2*(a*a*b-x)/A)**2+A))**0.5)))

Submission status: Accepted

Solution code:
from math import atan, degrees

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

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

Submission status: Accepted

Solution code:
import math
a,b,x=[int(x) for x in input().rstrip().split()]
S=x/a
if S==a*b:
  print(0)
else:
  if S<=(a*b)/2:
    a1=S/b
    tan=(b**2)/(2*S)
    print(math.degrees(math.atan(tan)))
  else:
    tan=(2*a*b-2*S)/a**2
    print(math.degrees(math.atan(tan)))

Submission status: Accepted

Solution code:
import math

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

if x <= ((a**2) * b / 2):
    ans = a * (b**2) / (2 * x)
else:
    ans = 2 * ((a**2 * b) - x) / a**3
e = 90
s = 0
while e - s > 10**(-8):
    m = (e + s) / 2
    z = math.tan(math.radians(m))
    if z == ans:
        s = m
        break
    elif z > ans:
        e = m
    else:
        s = m
print(s)

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit
from math import atan, degrees


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

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


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

Submission status: Accepted

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

ans = 0

sw = 2*x/(a**3)
sw_c = abs(math.atan(sw))

ans = abs(math.atan(2/a*(b-x/(a**2))))
ans_1 = abs(math.atan(a*b**2/(2*x)))

if(ans < sw_c):
    print(math.degrees(ans))
else:
    print(math.degrees(ans_1))

'''
print("------")
print(math.degrees(ans))
print(math.degrees(sw_c))
print(math.degrees(ans_1))
'''

Submission status: Accepted

Solution code:
from math import tan, pi, degrees

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

def solve(isOK):
    ng, ok = pi/2, 0
    while abs(ok-ng) > 10**-12:
        mid = (ng+ok) / 2
        if isOK(mid):
            ok = mid
        else:
            ng = mid
#    print('ok:', ok)
    print(degrees(ok))

def isOK1(theta):
    return a*a*tan(theta)/2 + x/a <= a*b
def isOK2(theta):
    return b*b/tan(theta)/2 >= x/a

if x/a >= a*b/2:
    solve(isOK1)
else:
    solve(isOK2)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
from math import atan, radians, degrees

a, b, x = map(int, input().split())
h = x/(a**2)
he = b - h

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

else:
    ans = degrees(atan(b**2/(2*h*a)))
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def solve():
    import math

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

    if x > a*a*b/2:
        s = x/a
        # a*b-s = a*h*(1/2)
        h = (a*b-s)*2/a
        theta = math.atan2(h, a)
        ans = math.degrees(theta)
        print(ans)

    else:
        s = x/a
        h = (s*2)/b
        theta = math.atan2(h, b)
        ans = 180-90-math.degrees(theta)
        print(ans)


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
"""
keyword: ラジアン, 度

最大限傾けたとき、水と接している面は横から見ると台形ないし三角形となる
水と接している面の面積 x/a が a*b/2 より大きい場合は台形となり、それ以下の場合は三角形となる

・台形の場合
最大限傾けたとき、水と接している台形の上辺の長さをhとすると
(h+b)*a/2 = x/a
h = 2*x/(a**2) - b
求める角度をthetaとすると
tan(theta) = (b-h)/a
theta = arctan((b-h)/a)

・三角形の場合
最大限傾けたとき、水と接している三角形の底辺の長さをhとすると
h*b/2 = x/a
h = 2*x/(a*b)
求める角度をthetaとすると
tan(theta) = b/h
theta = arctan(b/h)
"""

import sys
sys.setrecursionlimit(10**6)

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

import numpy as np

if x/a > a*b/2:
    h = 2*x/(a**2) - b
    theta = np.arctan2(b-h, a) # radian表記なので戻り値の範囲は[-pi/2, pi/2]
    theta = np.rad2deg(theta)
else:
    h = 2*x/(a*b)
    theta = np.arctan2(b, h)
    theta = np.rad2deg(theta)

print(theta)

Submission status: Accepted

Solution code:
"""
最大限傾けたとき、水と接している面は横から見ると台形ないし三角形となる
水と接している面の面積 x/a が a*b/2 より大きい場合は台形となり、以下の場合は三角形となる

台形の場合

最大限傾けたとき、水と接している台形の上辺の長さをnとすると
(n+b)*a/2 = x/a
n = 2*x/(a**2) - b
求める角度をthetaとすると
tan(theta) = (b-n)/a
theta = arctan((b-n)/a)

三角形の場合

最大限傾けたとき、水と接している三角形の底辺の長さをnとすると
n*b/2 = x/a
n = 2*x/(a*b)
求める角度をthetaとすると
tan(theta) = b/n
theta = arctan(b/n)
"""

import sys
sys.setrecursionlimit(10**6)

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

import numpy as np

if x/a > a*b/2:
    n = 2*x/(a**2) - b
    theta = np.arctan((b-n)/a) # radian表記なので戻り値の範囲は[-pi/2, pi/2]
    theta = np.rad2deg(theta)
else:
    n = 2*x/(a*b)
    theta = np.arctan(b/n)
    theta = np.rad2deg(theta)

print(theta)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import sys
from math import atan, degrees

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    a, b, x = map(int, readline().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))))

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
from math import atan, pi

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    a, b, x = map(int, readline().split())
    if x > a * a * b / 2:
        angle = atan(2 * (a * a * b - x) / a ** 3)
    else:
        angle = atan(a * b * b / (2 * x))

    print(angle / pi * 180)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print("{:.8f}".format(a*(180/math.pi)))

Submission status: Accepted

Solution code:
import math

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

s = x / a

if s >= a * b / 2:
    c = (a * b - s) * 2 / a
    rad = math.atan2(c, a)
else:
    c = s * 2 / b
    rad = math.atan2(b, c)

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

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

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

dig = math.degrees(math.atan(theta))
print(dig)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

a_ = 2 * x / a / b

import math

#print(a_, a, b, x)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# D

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect

# 再起回数上限変更
# sys.setrecursionlimit(1000000)
PI = math.pi

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

if x >= a * b / 2:
    x = a * b - x
    # print(x)
    # print(2*x/a**2)
    print(math.atan(2*x/a**2) * 180 / PI)
    sys.exit()
else:
    print(90 - math.atan(2 * x / b ** 2) * 180 / PI)
    sys.exit()

Submission status: Accepted

Solution code:
import numpy as np
a,b,x = map(int,input().split())
water = x/a
bottle = a*b
if water >= bottle * 0.5:
    margin = bottle - water
    tate = margin * 2 / a
    ans = np.degrees(np.arctan2(tate, a))
else:
    height = 2 * water / b
    beta = np.degrees(np.arctan2(height, b))
    ans = 2*(45 - beta/2)
print(ans)

Submission status: Accepted

Solution code:
import sys
import math

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

a, b, x = nm()
if 2 * x > a * a * b:
    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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

a, b, x = rl()

y = 2/(a**2)*x-b
if 0 <= y <= b:
	print(math.atan((b-y)/a) / math.pi * 180)
	exit()

y = 2/(a*b)*x
if 0 <= y <= a:
	print(math.atan(b/y) / math.pi * 180)
	exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b,x = map(int,input().split())
if a * a * b / 2 >= x:
  dx = 2 * x / a / b
  sha = math.sqrt(b * b + dx * dx)
  co = b / sha
  print(90 - math.degrees(math.acos(co)))
else:
  dx = 2 * (a * a * b - x) / a / a
  sha = math.sqrt(a * a + dx * dx)
  co = a / sha
  print(math.degrees(math.acos(co)))

Submission status: Accepted

Solution code:
from math import atan
from math import pi

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import *

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

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

Submission status: Accepted

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

    if x * 2 >= a * a * b:
        # 断面は台形
        d = (a * a * b - x) * 2 / (a * a)
        ans = degrees(atan2(d, a))
        print(ans)
        return

    else:
        # 断面は三角形
        d = (x * 2) / (a * b)
        ans = degrees(atan2(b, d))
        print(ans)
        return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

fullBottle = A*A*B

if fullBottle >= X*2:
    C = 2*X/(A*B)
    ans = math.degrees(math.atan(C/B))
    print(90-ans)
else:
    C = 2*(B-X/(A**2))
    ans = math.degrees(math.atan(C/A))
    print(ans)

Submission status: Accepted

Solution code:

import math

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

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

Submission status: Accepted

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

import math
import numpy as np
a,b,x = mi()

l,r = 0,90

for i in range(100):

    c = (r+l)/2
    cr = np.deg2rad(c)

    if b*np.sin(np.pi/2 - cr) >= a*np.sin(cr):
        capa = a*a /np.cos(cr)*np.sin(cr)/2 + a/np.cos(cr) * (b*np.sin(np.pi/2 - cr) - a*np.sin(cr))
        capa *= a
    else:
        capa = b*b/2/np.tan(cr) * a

    # print(r,l,c)
    # print(capa)
    # print('------')

    if capa <= x:
        r = c
    else:
        l = c

print(l)