CCC '14 S5 - Lazy Fox
Submit solution
Points:
1
Time limit:
1.0s
Memory limit:
256M
Problem types
Allowed languages
C++, Python
Output Specification
The output is one integer, the largest number of treats your Fox can gather.
Sample Input
5
5 8
4 10
3 1
3 2
3 3Output for Sample Input
6Explanation of Output for Sample Input
The Fox performs the visits in the following order (with the indicated distances):
- \((0, 0)\) to \((4, 10)\) with distance \(\sqrt{116}\) ;
- \((4, 10)\) to \((3, 1)\) with distance \(\sqrt{82}\) ;
- \((3, 1)\) to \((5, 8)\) with distance \(\sqrt{53}\) ;
- \((5, 8)\) to \((3, 3)\) with distance \(\sqrt{29}\) ;
- \((3, 3)\) to \((3, 1)\) with distance \(2\) ;
- \((3, 1)\) to \((3, 2)\) with distance \(1\) .
Comments