Source code for submission s705

Mosquito.java

  1. import java.util.Scanner;
  2.  
  3. public class Mosquito {
  4.  
  5. static int M, P, L, E, R, S, N;
  6.  
  7. public static void main(String[] args) throws Exception {
  8. Scanner sc = new Scanner(System.in);
  9. while (sc.hasNextInt()) {
  10.  
  11. M = sc.nextInt();
  12. P = sc.nextInt();
  13. L = sc.nextInt();
  14. E = sc.nextInt();
  15. R = sc.nextInt();
  16. S = sc.nextInt();
  17. N = sc.nextInt();
  18.  
  19.  
  20. int phase = N % 3;
  21. int steps = N / 3;
  22.  
  23. if (phase == 0) {
  24.  
  25. }
  26. if (phase == 1) {
  27. M = P / S;
  28. }
  29. if (phase == 2) {
  30. M = (L / R) / S;
  31. }
  32.  
  33. for (int i=0; i < steps; i++) {
  34. M = ((M * E) / R) / S;
  35.  
  36. }
  37.  
  38. System.out.println(M);
  39.  
  40.  
  41. }
  42. }
  43. }
  44.  
  45.  
  46.  
  47.