def launch_distance(speed, duration):
    """Returns the launch movement distance for given speed and time in ms."""  
    if speed <= 0 or duration <= 0:
        return 0
    time = pow(speed/25000, -0.95)
    diff = time - duration
    return 90 - int(diff/time*90)