import scala.io.StdIn._
object Main extends App {
  val Array(n, k) = readLine.trim.split(' ').map(_.toInt)
  val d = Angle.fromAngle(k * 360d / 2 / n).cos / Angle.fromAngle((k - 1) * 360d / 2 / n).cos
  val result = (0 until n).map{a ⇒
    val ca = Coordinate(Angle.fromAngle(a * 360d / n))
    val cb = Coordinate(Angle.fromAngle((a + 1) % n * 360d / n))
    val cm = Coordinate(Angle.fromAngle((2 * a + 1) * 180d / n)) * d
    (ca, cm, cb)
  }
  println(
    f"${result.map{case (f, m, t) ⇒ (f.x - m.x) * (f.y + m.y) + (m.x - t.x) * (m.y + t.y)}.sum / 2}%.10f"
  )
}
object Coordinate{
  def apply(angle: Angle): Coordinate = Coordinate(angle.cos, angle.sin)
}
case class Coordinate(x: Double, y: Double) {
  def *(that: Double): Coordinate = Coordinate(x * that, y * that)
}
object Angle {
  def fromAngle(angle: Double): Angle = {
    Angle(math.sin(angle / 180 * math.Pi), math.cos(angle / 180 * math.Pi))
  }
}
case class Angle(sin: Double, cos: Double)
