https://www.acmicpc.net/problem/6609
import java.util.*
import java.lang.String.format
fun main(args: Array<String>) {
val sc=Scanner(System.`in`)
while(sc.hasNextInt()){
var m=sc.nextInt()
var p=sc.nextInt()
var l=sc.nextInt()
var e=sc.nextInt()
var r=sc.nextInt()
var s=sc.nextInt()
var n=sc.nextInt()
for(i in 0 until n){
var sum=m
m=p/s
p=l/r
l=sum*e
}
println(m)
}
}