import java.lang.Math.abs
import java.lang.Math.min

fun main(args:Array<String>?): Unit {
    val (t, d) = readLine()!!.trim().split(' ').map(String::toInt)
    val (ta, tb) = readLine()!!.trim().split(' ').map(String::toDouble)
    val (da, db) = readLine()!!.trim().split(' ').map(String::toInt)
    var minDiff = Double.MAX_VALUE
    for (sum in min(da, db) .. d){
        for (va in (0 .. sum / da).map{it * da}){
            val vb = (sum - va) / db * db
            val temp = (ta * va + tb * vb) / (va + vb)
            if (minDiff > abs(t - temp)) {
                minDiff = abs(t - temp)
            }
        }
    }
    println("%.10f".format(minDiff))
}
