require 'bigdecimal'
require 'bigdecimal/util'
input = gets.chomp.split(" ").map(&:to_i)

N = input[0]
M = input[1]

routes = []

M.times do
  route = gets.chomp.split(" ").map(&:to_i)
  routes << route
end

routes.sort_by!{|route| route[0]}
routes = routes.reverse
# ここまででrouteが4に行くもの、３に向かうもの、という順で並ぶ

index = N - 2
expectations = Array.new(N,0)
while index >= 0 do
  routes2 = routes.dup
  data = []
  routes.each do |e|
    if e[0]==(index + 1)
      data << e[1]
      routes2.delete(e)
    else
      break
    end
  end
  sum = 0
  result = []
  data.each do |e|
    # 青木くんの妨害
    if index == 0 
      result << expectations[e - 1]
    else
      sum += expectations[e-1]
      expectations[index] = sum / data.length.to_d  + 1
  end
end
routes = routes2
index -= 1
end

if result.length != 1
  result.delete(result.max)
end

result.each do |f|
  sum += f
end

puts sum / result.length.to_d + 1
