osu! klikin sircles

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

jsumabat loves clicking circles. Well, actually, he loves to play osu! whenever he can. osu! involves clicking circles, holding them while they move, and spinning circles; however, we will only be focussing on the clicking aspect today.

There will be N circles in the map given to jsumabat. If jsumabat were to click them as accurately as possible, what would be the minimum distance (rounded to the nearest integer) his mouse cursor would travel?

Please note that jsumabat must click the circles in the order given, and that his cursor will start dead centre of the first circle appears.

Input Specification

The first line of input will contain N (1 \le N \le 10^4), the number of circles in the map.

The next N lines of input will contain a pair of integers, x_i and y_i (1 \le x_y, y_i \le 100), the cartesian coordinates of the circle.

Output Specification

You are to output a single integer - the minimum distance jsumabat's cursor will travel, rounded down to the nearest integer.

Sample Input

3
1 2
5 6
8 4

Sample Output

9

Comments

There are no comments at the moment.