1020
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <math.h>
 
using namespace std;
 
#define pb push_back 
#define FOR(_i,_n)        for(int _i = 0; (_i) < (_n); (_i)++)
#define M_PI       3.14159265358979323846
 
int main(void)
{
    int n;
    double r;
    vector< pair<double,double> > v;
    double res = 0.0;
 
    cin >> n >> r;
 
    FOR(i,n)
    {
        double x,y;
        cin >> x >> y;
        v.pb(make_pair(x,y));
    }
    v.pb(v[0]);
 
    FOR(i,n)
    {
        res += _hypot(v[i+1].first-v[i].first, v[i+1].second-v[i].second);
    }
 
    res += 2*M_PI*r;
 
    printf("%0.2lf", res);
    return 0;
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.