Galaxy distances

SPOJ - WPC5E