local mma, mmi = math.max, math.min
local n, m = io.read("*n", "*n")
local edge = {}
local inf = n + 1
for i = 1, n do
  edge[i] = {}
end
for i = 1, m do
  local a, b = io.read("*n", "*n")
  table.insert(edge[a], b)
end

local len = {}
local function solve(z)
  for i = 1, n - 1 do
    len[i] = inf
  end
  len[n] = 0
  for idx = n - 1, 1, -1 do
    if #edge[idx] == 1 then
      len[idx] = 1 + len[edge[idx][1]]
    else
      local lensum, lenmax = 0, 0
      for i = 1, #edge[idx] do
        local v = len[edge[idx][i]]
        lensum = lensum + v
        lenmax = mma(lenmax, v)
      end
      if z == idx then
        len[idx] = 1 + (lensum - lenmax) / (#edge[idx] - 1)
      else
        len[idx] = 1 + lensum / #edge[idx]
      end
    end
  end
  return len[1]
end
local ret = solve(1)
for i = 2, n do
  ret = mmi(ret, solve(i))
end
print(string.format("%.9f", ret))
