#!/usr/bin/env ruby
#-*- coding: utf-8 -*-

include Math
hankei = 100
puts("何角形？")
kadonokazu = gets.chomp.to_i

kakudo = 360.0 / kadonokazu / 2.to_f

puts (kakudo)


w = kakudo * Math::PI / 180.to_f
ippen=Math.sin(w) * hankei * 2.to_f

gaishu = ippen * kadonokazu.to_f
pai = gaishu / (hankei * 2)
printf("%d角形から計算した円周率は　%.30f\n",kadonokazu,pai)
