let scan_int () = Scanf.scanf " %d" (fun x -> x)
let print_float n = Printf.printf "%.12f\n" n

(* 辺の入力 *)
let input_edge edges m =
  for i = 0 to m-1 do
    let s = scan_int() and t = scan_int() in
    edges.(s-1) <- (t-1) :: edges.(s-1) 
  done

(* 頂点vからの期待値の計算 *)
let calc_expected_value n edges =
  let expected = Array.make n 0.0 in
  let prop expect p u v = expect.(u) <- expect.(u) +. (expect.(v) +. 1.0) *. p in
  let rec rev_calc curr edges ret =
    if curr < 0 then ret
    else
      let p = 1.0 /. (float (List.length edges.(curr))) in
      let _ = List.iter (prop ret p curr) edges.(curr) in
      rev_calc (curr-1) edges ret in
  rev_calc (n-1) edges expected

(* 頂点vを通る確率の計算 *)
let calc_probability n edges =
  let probability = Array.make n 0.0 in
  let _ = probability.(0) <- 1.0 in
  let prop prob p u v = prob.(v) <- prob.(v) +. prob.(u) *. p in
  let rec calc curr edges ret =
    if curr = n then ret
    else
      let p = 1.0 /. (float (List.length edges.(curr))) in
      let _ = List.iter (prop ret p curr) edges.(curr) in
      calc (curr+1) edges ret in
  calc 0 edges probability


let solve n edges expected probability =
  let ans = ref expected.(0) in
  let p = expected.(0) in
  let _ =
    for u = 0 to n-1 do
      let l = List.length edges.(u) in
      if l <= 1 then ()
      else
        let add_prob = 1.0 /. (float (l-1)) -. 1.0 /. (float l) in
        let fold_func p v = p +. add_prob *. expected.(v) *. probability.(u) in
        let ref_value = List.fold_left fold_func p edges.(u) in
        let sub_prob = 1.0 /. (float (l-1)) in
        let calc_func v =
          let result = ref_value -. sub_prob *. expected.(v) *. probability.(u) in
          ans := min !ans result in
        List.iter calc_func edges.(u)
    done in
  print_float !ans


let () =
  let n = scan_int() and m = scan_int() in
  let edges = Array.make n [] in
  let _ = input_edge edges m in
  let expected = calc_expected_value n edges in
  let probability = calc_probability n edges in
  solve n edges expected probability