#include <bits/stdc++.h>
using namespace std;
struct Vec {
  double x, y;
  Vec(double newX = 0, double newY = 0) {
    x = newX;
    y = newY;
  }
  Vec operator+(Vec r) { return Vec(x + r.x, y + r.y); }
  Vec operator-(Vec r) { return Vec(x - r.x, y - r.y); }
  Vec operator*(double r) { return Vec(x * r, y * r); }
  Vec operator/(double r) { return Vec(x / r, y / r); }
  double operator*(Vec r) { return x * r.x + y * r.y; }
  Vec normal() { return Vec(y, -x); }
  double len() { return sqrt(x * x + y * y); }
};
double cprod(Vec l, Vec r) { return l.x * r.y - l.y * r.x; }
Vec intersection(Vec first1, Vec first2, Vec second1, Vec second2) {
  Vec n1 = (first2 - first1).normal();
  Vec n2 = (second2 - second1).normal();
  double c1 = first1 * n1;
  double c2 = second1 * n2;
  double x = c1 * n2.y - c2 * n1.y;
  double y = c2 * n1.x - c1 * n2.x;
  double div = n1.x * n2.y - n1.y * n2.x;
  return Vec(x, y) / div;
}
double getArea(vector<Vec> pts) {
  double result = 0;
  for (size_t i = 0; i < pts.size(); i++)
    result += cprod(pts[i], pts[(i + 1) % pts.size()] - pts[i]) / 2;
  return abs(result);
}
int n, r;
double pi = acos(-1);
Vec getPt(int ind) {
  ind = (ind % n + n) % n;
  return Vec(r * sin(2 * pi * ind / n), r * cos(2 * pi * ind / n));
}
int main() {
  double area = 0;
  cin >> n >> r;
  {
    vector<Vec> pts = {
        getPt(0),
        intersection(getPt(0), getPt(-n / 2), getPt(-1), getPt(n / 2 - 1)),
        Vec(0, 0),
        intersection(getPt(0), getPt(n / 2), getPt(1), getPt(1 - n / 2)),
    };
    area += getArea(pts);
  }
  area = area * n;
  cout << fixed << setprecision(8) << area << '\n';
  return 0;
}
