Family dinner in Farfaraway X48464


Statement
 

pdf   zip

html

Input The program will receive the following information:

  • The first line indicates the 3D coordinates of the Farfaraway planet separated by spaces.
  • The second line indicates the number of additional planets (up to 50) where we may stop for refueling. For each additional planet, we will have a line in the input with their 3D coordinates separated by spaces.

Output We need you to code a program that indicates whether it is possible to travel from the Earth to Farfaraway with the spaceship. The output will consist of one line indicating “yes” if it is possible to reach Farfaraway with any required refueling stops, or “no” otherwise.

Public test cases
  • Input

    2000 0 0
    3
    0 500 0
    1600 0 0
    800 0 0
    

    Output

    yes
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    Java
    User solutions
    C++ Python