1 / 2
Sep 2022

Code:
import sys
import math

for i in sys.stdin:
    ab = i.split()
    a = int(ab[0])
    b = int(ab[1])
    s = int(ab[2])
    m = int(ab[3])
    n = int(ab[4])

    if(a+b+s+m+n == 0):
        break;


    horzDistance = a * m
    vertDistance = b * n
    Speed  = math.sqrt((horzDistance)**2 + vertDistance ** 2) / s
    Angle = math.atan(vertDistance/horzDistance) * (180/math.pi)
    print(round(Angle,2),round(Speed,2))

I am getting right answer to provided inputs upon testing but WA on submitting not sure why :frowning:

  • created

    Sep '22
  • last reply

    Sep '22
  • 1

    reply

  • 539

    views

  • 2

    users

  • 1

    link

Try this test case:

1804 4509 7608 4296 2627
0 0 0 0 0

Expected answer is

56.80 1860.57

(And if that’s your issue, I agree it’s poorly worded in the problem.)

BILLIARD5