Cses Planet Queries question

I am trying this question on cses but has no luck, any help would be appreciated.
Planet Queries I

Which part of the question are you having trouble with?