def donut_taiseki(r_in, r_out) r_in = r_in.to_f r_out = r_out.to_f r = (r_out - r_in) / 2 return Math::PI * r * r * (r_out + r_in) * Math::PI end c = gets.to_i r_in, r_out = gets.split.map(&:to_i) cal = donut_taiseki(r_in, r_out) * c puts cal