In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.
Byteotia consists of oasis in the desert, no three of which are collinear. Byteasar lives in one of these oasis and moreover he has an acquaintance in every other. Byteasar wants to pay a visit to as many of them as possible. He plans to travel on the back of his camel. The camel is as obstinate as a mule and thus moves in its own peculiar way:
Help Byteasar in planning such a route that he will be able to visit as many friends as possible. It should both begin and end in the oasis where Byteasar lives. It has to consist of segments connecting subsequently visited oasis. The route may not pass through any point two times, except the Byteasar's oasis, where the camel turns up twice: at the beginning and the end of the journey.
Byteasar's camel is initially facing a certain oasis and it has to start moving toward it. The direction the camel faces after returning from the journey is of no importance.
Write a programme that:
In the first line of the standard input there is one integer () - the number of oasis in Byteotia. The oasis are numbered from to . Byteasar lives in the oasis no. and his camel is facing the oasis no. . In the following lines the coordinates of the oasis are given. In the 'th line there are two integers , - the horizontal and vertical coordinate of the 'th oasis - separated by a single space. All coordinates are from the interval from to .
In the first and only line of the standard output your programme should write one integer - the maximum number of friends Byteasar can visit.
For the input data:
6 1 1 -1 4 0 -1 4 1 0 3 1 4
the correct result is:
4
Task author: Pawel Parys.