Source code for submission s656

Mosquito.java

  1.  
  2. import java.util.Scanner;
  3.  
  4. /*
  5.  * To change this template, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8. /**
  9.  *
  10.  * @author cteam051
  11.  */
  12. public class Mosquito {
  13.  
  14. /**
  15.   * @param args the command line arguments
  16.   */
  17. public static void main(String[] args) {
  18. Scanner sc = new Scanner(System.in);
  19. int M, P, L, E, R, S, N;
  20. int puppae, larvae, mosqs;
  21. while (sc.hasNextInt()) {
  22. M = sc.nextInt();
  23. P = sc.nextInt();
  24. L = sc.nextInt();
  25. E = sc.nextInt();
  26. R = sc.nextInt();
  27. S = sc.nextInt();
  28. N = sc.nextInt();
  29. puppae = 0;
  30. larvae = 0;
  31. mosqs = 0;
  32. for (int i = 0; i < N; i++) {
  33. larvae = M * E;
  34. puppae = L / R;
  35. mosqs = P / S;
  36. M = mosqs;
  37. P = puppae;
  38. L = larvae;
  39. }
  40. System.out.println(M);
  41. }
  42. }
  43. }
  44. //10 20 40 4 2 2 10
  45. //144 55 8 0 1 9 4
  46. //10 10 10 2 3 2 6
  47. //10 20 40 86 9 9 999
  48.