import strscans let (_, a, b, x, y) = stdin.readLine.scanTuple "$f $f $f $f" a2 = x / a b2 = y / b echo: if a2 < b2: a2 * (a + b) else: b2 * (a + b)