import scala.io.StdIn.readLine @main def yuki2850(): Unit = val abcd = readLine.split(" ").map(_.toInt) val (a, b, c, d) = (abcd(0), abcd(1), abcd(2), abcd(3)) val x = if a == 0 then 1 << 30 else c / a val y = if b == 0 then 1 << 30 else d / b println(x.min(y))