print1412. Boy Scouts

printBoy Scouts

Ограничения: время – 2s/4s, память – 64MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод copy
Послать решение Blockly Посылки Темы Где Обсудить (0)

Boy Scouts of New England organize Scout Olympics every year. They ask each team to perform certain tasks, sum up their points, announce winners, and then stay up all night by the fire plying guitar and singing scout songs.
This year, Scouts decided to organize the Olympics in one of the most beautiful forests in Maine. There will be only one dificult task. A team picks one tree as a starting point, then goes to another tree in a straight line, then to another, etc. until they come back to the starting one. They win as many points as there are trees on their route. However, they are only allowed to move in a counter-clockwise manner, i.e. after reaching a tree, they can only rotate to the left by less than 180 degrees. Furthermore, when they reach the starting tree again, they should be able to repeat the same route, still going couter-clockwise. As they don't bring laptops to the Olympics, the Scouts ask you to compute the maximum possible score a team can achieve.
Input
The first line of the input contains a single integer `N` (`3\ ≤\ N\ ≤\ 100`), which is the number of trees in the forest. Each of the next `N` lines contain two real numbers `x` and `y` separated by a space character (`-10^6\ ≤\ x,\ y\ ≤\ 10^6`), that represent coordinates of one tree. Coordinates are given with at most two decimal digits. There are no three collinear trees.
Output
Output one integer, the maximum number of points a team can score, followed by a newline.

Sample Input

5
0 0
1.5 -0.25
0 -1
-1 0.5
0.5 1

Sample Output

4
Source: MIT Programming Contest, Individual Round, 2008
loading