ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
back to board

Discussion of Problem 1850. Space Tourism

please, explain example?
Posted by xurshid_n 10 Aug 2012 17:06
Re: please, explain example?
Posted by Erop [USU] 10 Aug 2012 20:32
There is two clusters of planets: first cluster - planets on distance 10, 20, 30 from Betelgeuse, and second - 50, 60.
If tourist start with any planet from cluster - he can get to any another planet from this cluster, but can't get to any planet from any another cluster.
Every tourist has another restriction: max and min distance to Betelgeuse, so first tourist can visit {10, 20, 30} or {50, 60} in first set only one race, in second set - two races. So answer for first tourist is 2.
Second tourist can visit only {20, 30} - one race - answer is 1.