Problem p02677 (python)

Fixed submission:
import math
A,B,H,M = map(int,input().split())


H = H/12 * 60
H = H + (1/12 * M)
shita = math.radians(abs(H-M)*6)
if shita > math.pi:
    shita = 2*math.pi - shita
cos_shita = math.cos(shita)
c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
print(math.sqrt(c_zizyou))

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
if M == (H/5+M/12):
    print(abs(A-B))

elif M == (H/5+M/12) + 30 or M == (H/5+M/12) - 30:
    print(A+B)

elif H == 0:
    print(L)
    shita = math.radians(M*6)
    if shita > math.pi:
        shita = 2*math.pi - shita
    cos_shita = math.cos(shita)
    c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
    print(math.sqrt(c_zizyou))
elif M == 0:
    shita = math.radians(H*30)
    if shita > math.pi:
        shita = 2*math.pi - shita
    cos_shita = math.cos(shita)
    c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
    print(math.sqrt(c_zizyou))
else:
    H = H/12 * 60
    H = H + (1/12 * M)
    shita = math.radians(abs(H-M)*6)
    if shita > math.pi:
        shita = 2*math.pi - shita
    cos_shita = math.cos(shita)
    c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
    print(math.sqrt(c_zizyou))

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
if (M/60)*12 == H:
    print(A+B)
elif (M/60)*12 == H + 6 or (M/60)*12 == H - 6:
    print("0")
elif H == 0:
    shita = math.radians(M*6)
        if shita > math.pi:
        shita = 2*math.pi - shita
    cos_shita = math.cos(shita)
    c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
    print(math.sqrt(c_zizyou))
elif M == 0:
    shita = math.radians(H*30)
        if shita > math.pi:
        shita = 2*math.pi - shita
    cos_shita = math.cos(shita)
    c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
    print(math.sqrt(c_zizyou))
else:
    H = H/12 * 60
    H = H + (1/12 * M)
    shita = math.radians(abs(H-M)*6)
        if shita > math.pi:
        shita = 2*math.pi - shita
    cos_shita = math.cos(shita)
    c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
    print(math.sqrt(c_zizyou))

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
if (M/60)*12 == H:
    print(A+B)
elif (M/60)*12 == H + 6 or (M/60)*12 == H - 6
    print("0")
elif H == 0:
    shita = math.radians(M*6)
        if shita > math.pi:
        shita = 2*math.pi - shita
    cos_shita = math.cos(shita)
    c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
    print(math.sqrt(c_zizyou))
elif M == 0:
    shita = math.radians(H*30)
        if shita > math.pi:
        shita = 2*math.pi - shita
    cos_shita = math.cos(shita)
    c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
    print(math.sqrt(c_zizyou))
else:
    H = H/12 * 60
    H = H + (1/12 * M)
    shita = math.radians(abs(H-M)*6)
        if shita > math.pi:
        shita = 2*math.pi - shita
    cos_shita = math.cos(shita)
    c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
    print(math.sqrt(c_zizyou))

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
if H == 0:
    shita = math.radians(M*6)
    print(L)
elif M == 0:
    shita = math.radians(H*30)
else:
    H = H/12 * 60
    H = H + (1/12 * M)
    shita = math.radians(abs(H-M)*6)
if shita > math.pi:
    shita = 2*math.pi - shita
cos_shita = math.cos(shita)
c_zizyou = A**2 + B**2 - 2 * A * B * cos_shita
print(math.sqrt(c_zizyou))