require 'prime' k = gets.chomp.to_i def is_prime(k) Prime.instance.prime?(k) end if is_prime(k) puts "0.00000000000000000" else puts "0.0277777777777777778" end