Mosquito.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author cteam040
*/
import java.util.*;
import java.io.*;
public class Mosquito {
public static long m, p, l, e, r, s, n;
while((ln = br.readLine()) != null) {
m
= Long.
parseLong(st.
nextToken()); p
= Long.
parseLong(st.
nextToken()); l
= Long.
parseLong(st.
nextToken()); e
= Long.
parseLong(st.
nextToken()); r
= Long.
parseLong(st.
nextToken()); s
= Long.
parseLong(st.
nextToken()); n
= Long.
parseLong(st.
nextToken());
System.
out.
println(compute
(n
)[0]);; }
}
public static long[] compute(long n) {
if(n == 0) {
return new long[]{m, p, l};
}
long [] lowerLvl = compute(n - 1);
return new long[]{(long)Math.
floor((double)lowerLvl
[1]/s
),
(long)Math.
floor((double)lowerLvl
[2]/r
), lowerLvl
[0]*e
}; }
}