import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.{Map, Stack, Queue, PriorityQueue, Set}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val N, M = in.next().toInt
  val graph = Array.fill[List[Int]](N+1)(Nil)

  //
  for (_ <- 1 to M) {
    val s, t = in.next().toInt
    graph(s) = t :: graph(s)
  }

  val dp = new Array[Double](N+1)
  var ans = Double.MaxValue
  for (k <- 1 to N) {
    for (i <- 1 to N-1)
      dp(i) = Double.MaxValue

    for (i <- (1 to N-1).reverse) {
      val l = graph(i).length

      if (i == k && l > 1) {
        dp(i) = graph(i)
          .map(e => dp(e) + 1)
          .sorted.reverse.tail.sum / (l - 1)
      }
      else {
        if (l > 0)
          dp(i) = graph(i)
            .map(e => dp(e) + 1)
            .sum / l
      }
    }

    if (dp(1) < ans)
      ans = dp(1)
  }

  println(ans)
}

class InputReader(stream: InputStream) {
  private[this] val reader = new BufferedReader(new InputStreamReader(stream))
  private[this] var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}
