import java.io.{BufferedReader, InputStreamReader}

import scala.collection.mutable.ListBuffer

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val Array(n, m) = in.readLine().split("\\s+").map(_.toInt)

    val rooms = new Array[ListBuffer[Int]](n)
    for {
      i <- rooms.indices
    } {
      rooms(i) = new ListBuffer[Int]
    }

    (1 to m).foreach { _ =>
      in.readLine().split("\\s+").map(_.toInt) match {
        case Array(s, t) => rooms(s - 1) += t - 1
      }
    }

    val exps = new Array[Double](n)

    def expectation(aoki: Int): Double = {
      exps(n - 1) = 0.0
      for {
        i <- n - 2 to 0 by -1
      } {
        exps(i) = {
          val (sum, max) = rooms(i).foldLeft((0.0, 0.0)) {
            case ((sum, max), roomId) =>
              (sum + exps(roomId), Math.max(exps(roomId), max))
          }
          val size = rooms(i).length
          if (size == 1) {
            sum + 1.0
          } else if (i == aoki) {
            (sum - max) / (size - 1) + 1.0
          } else {
            sum / size + 1.0
          }
        }
      }
      exps(0)
    }

    val minE = rooms.indices.foldLeft(Double.MaxValue) {
      case (e, aoki) => Math.min(expectation(aoki), e)
    }

    System.out.println(f"$minE%2.10f")
  }
}