Buggy python submission (verdict: Runtime Error):
a,b,h,m = map(int,input().split())

ang = abs(h * 30 + m * 0.5- m * 6)
print(ang)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b-a))
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))

Fixed submission:
import math

a, b, h, m = map(int, input().split())
h=h*60+m

ang=abs(h*0.5-m*6)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b-a))
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))

Buggy python submission (verdict: Runtime Error):
a = int(input()) #ch
b = int(input())  #ch
h = int(input())  #hour
m = int(input())  #minits

import math

angle = abs(h * 30 + m * 0.5- m * 6)

if angle > 180:
    angle = 360 - angle
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b - a)):
else:
cos = math.cos(math.radians(angle))
ans = (a * a) + (b * b) - (2 * a * b * cos)
print(math.sqrt(ans))



Fixed submission:
import math

a, b, h, m = map(int, input().split())
h=h*60+m

ang=abs(h*0.5-m*6)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b-a))
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))

Buggy python submission (verdict: Runtime Error):
a = int(input()) #ch
b = int(input())  #ch
h = int(input())  #hour
m = int(input())  #minits

import math

ang = abs(h * 30 + m * 0.5- m * 6)

if angle > 180:
    angle = 360 - angle
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b - a)):
else:
cos = math.cos(math.radians(angle))
ans = (a * a) + (b * b) - (2 * a * b * cos)
print(math.sqrt(ans))



Fixed submission:
import math

a, b, h, m = map(int, input().split())
h=h*60+m

ang=abs(h*0.5-m*6)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b-a))
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))

Buggy python submission (verdict: Runtime Error):
a = int(input()) #ch
b = int(input())  #ch
h = int(input())  #hour
m = int(input())  #minits

import math

angle = abs((30 * h + m * 0.5) - m*6)

if angle > 180:
    angle = 360 - angle
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b - a)):
else:
cos = math.cos(math.radians(angle))
ans = (a * a) + (b * b) - (2 * a * b * cos)
print(math.sqrt(ans))



Fixed submission:
import math

a, b, h, m = map(int, input().split())
h=h*60+m

ang=abs(h*0.5-m*6)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b-a))
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))

Buggy python submission (verdict: Runtime Error):
a = int(input()) #ch
b = int(input())  #ch
h = int(input())  #hour
m = int(input())  #minits

import math

angle = abs((30 * h + m * 0.5) - m*6)

if angle > 180:
    angle = 360 - angle

cos = math.cos(math.radians(angle))
ans = (a * a) + (b * b) - (2 * a * b * cos)
print(math.sqrt(ans))

Fixed submission:
import math

a, b, h, m = map(int, input().split())
h=h*60+m

ang=abs(h*0.5-m*6)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b-a))
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))

Buggy python submission (verdict: Runtime Error):
a = int(input()) #ch
b = int(input())  #ch
h = int(input())  #hour
m = int(input())  #minits

import math

angle = abs((30 * h + m * 0.5) - m*6)

if angle > 180:
    angle = 360 - angle

cos = math.cos(math.radians(angle))
ans = (a * a) + (b * b) - (2 * a * b * cos)
print(math.sqrt(ans))


Fixed submission:
import math

a, b, h, m = map(int, input().split())
h=h*60+m

ang=abs(h*0.5-m*6)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b-a))
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))

Buggy python submission (verdict: Runtime Error):
a = int(input()) #ch
b = int(input())  #ch
h = int(input())  #hour
m = int(input())  #minits
import math


angle = abs((30 * h + m * 0.5) - m*6)

if angle > 180:
    angle = 360 - angle

cos = math.cos(math.radians(angle))
ans = (a * a) + (b * b) - (2 * a * b * cos)
print(math.sqrt(ans))


Fixed submission:
import math

a, b, h, m = map(int, input().split())
h=h*60+m

ang=abs(h*0.5-m*6)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b-a))
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))

Buggy python submission (verdict: Runtime Error):
a = int(input()) #ch
b = int(input())  #ch
h = int(input())  #hour
m = int(input())  #minits
import math

h_len = h * 30
m_len = m * 6

angle = h_len - m_len
if angle < 0:
    angle = angle * -1

if angle > 180:
    angle = 360 - angle

cos = math.cos(math.radians(angle))
# cos = math.cos(angle)
ans = a * a + b * b - 2 * a * b * cos
print(math.sqrt(ans))

Fixed submission:
import math

a, b, h, m = map(int, input().split())
h=h*60+m

ang=abs(h*0.5-m*6)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(abs(b-a))
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))