Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
a = 30*H + 0.5*M
b = M*6
if abs(a-b) < 180:
    ab = abs(a-b)
else:
    ab = abs(360-a-b)
ab1 = round(math.cos(math.radians(ab)),20)
ans = round(math.sqrt(A**2 + B**2 - 2 * A* B*ab1),20)
print(round(ans,10)

Fixed submission:
import math
A,B,H,M = map(int,input().split())
a = 30*H + 0.5*M
b = M*6
if abs(a-b) < 180:
    ab = abs(a-b)
else:
    ab = 360 - abs(a-b)
ab1 = round(math.cos(math.radians(ab)),20)
ans = round(math.sqrt(A**2 + B**2 - 2 * A* B*ab1),20)
print(round(ans,20))

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
A2 = A**2
B2 = B**2
a = 30*H + 0.5*M
b = M*6
F  = 0

ab = min(abs(a-b),abs(360-a-b))
ab1 = math.cos(math.radians(ab))
print(ab)
ab_angle = -2*A*B*ab1
ans = (A2 + B2 +ab_angle)**0.5
if ab  == 0:
    print(abs(A-B))
elif ab == 180:
    printF(A+B)
else:
    print(ans)

Fixed submission:
import math
A,B,H,M = map(int,input().split())
a = 30*H + 0.5*M
b = M*6
if abs(a-b) < 180:
    ab = abs(a-b)
else:
    ab = 360 - abs(a-b)
ab1 = round(math.cos(math.radians(ab)),20)
ans = round(math.sqrt(A**2 + B**2 - 2 * A* B*ab1),20)
print(round(ans,20))

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
A2 = A**2
B2 = B**2
a = 30*H + 0.5*M
b = M*6
F  = 0

ab = min(abs(a-b),abs(360-a-b))
ab1 = math.cos(math.radians(ab))
print(ab)
ab_angle = -2*A*B*ab1
ans = (A2 + B2 +ab_angle)**0.5
if ab  == 0:
    print(abs(A-B))
elif ab == 180:
    printF(A+B)
else:
    print(ans)

Fixed submission:
import math
A,B,H,M = map(int,input().split())
a = 30*H + 0.5*M
b = M*6
if abs(a-b) < 180:
    ab = abs(a-b)
else:
    ab = 360 - abs(a-b)
ab1 = round(math.cos(math.radians(ab)),20)
ans = round(math.sqrt(A**2 + B**2 - 2 * A* B*ab1),20)
print(round(ans,20))

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
A2 = A**2
B2 = B**2
a = 30*H + 0.5*M
b = M*6
F  = 0

ab = min(abs(a-b),abs(360-a-b))
ab_angle = -2*A*B*ab
ans = math.sqrt(A2 + B2 +ab_angle)
print(ans)

Fixed submission:
import math
A,B,H,M = map(int,input().split())
a = 30*H + 0.5*M
b = M*6
if abs(a-b) < 180:
    ab = abs(a-b)
else:
    ab = 360 - abs(a-b)
ab1 = round(math.cos(math.radians(ab)),20)
ans = round(math.sqrt(A**2 + B**2 - 2 * A* B*ab1),20)
print(round(ans,20))

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
A2 = A**2
B2 = B**2
pi = round(math.pi,20)
a = 30*H + 0.5*M
b = M*6
F  = 0
if abs(a-b) == 180:
    F = 1
    print(A+B)
elif abs(a-b) ==0:
    F = 1
    print(abs(A-B))
elif abs(a-b) < 180 and 0 < abs(A-B):
    angle = round(math.cos(math.radians(abs(a-b))),20)
elif 180 < abs(a-b):
    angle = round(math.cos(math.radians(abs(360-a-b))),20)

if F == 0:
    ab_angle = round(2*A*B*angle,20)
    print(round((A2 + B2 - ab_angle)**0.5,20))

Fixed submission:
import math
A,B,H,M = map(int,input().split())
a = 30*H + 0.5*M
b = M*6
if abs(a-b) < 180:
    ab = abs(a-b)
else:
    ab = 360 - abs(a-b)
ab1 = round(math.cos(math.radians(ab)),20)
ans = round(math.sqrt(A**2 + B**2 - 2 * A* B*ab1),20)
print(round(ans,20))

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
A2 = A**2
B2 = B**2
pi = round(math.pi,20)
a = 30*H + 0.5*M
b = M*6
F  = 0
if abs(a-b) == 180:
    F = 1
    print(A+B)
elif abs(a-b) ==0:
    F = 1
    print(0)
elif abs(A-B) < 180:
    angle = round(math.cos(math.radians(abs(a-b))),20)
elif 180 < abs(a-b) and 0 < abs(a-b):
    angle = round(math.cos(math.radians(abs(360-a-b))),20)

if F == 0:
    ab_angle = round(2*A*B*angle,20)
    print(round((A2 + B2 - ab_angle)**0.5,20))

Fixed submission:
import math
A,B,H,M = map(int,input().split())
a = 30*H + 0.5*M
b = M*6
if abs(a-b) < 180:
    ab = abs(a-b)
else:
    ab = 360 - abs(a-b)
ab1 = round(math.cos(math.radians(ab)),20)
ans = round(math.sqrt(A**2 + B**2 - 2 * A* B*ab1),20)
print(round(ans,20))