Source code for submission s694

Mosquito.java

  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package mosquito;
  6.  
  7. import java.util.Scanner;
  8.  
  9. /**
  10.  *
  11.  * @author student
  12.  */
  13. public class Mosquito {
  14.  
  15. /**
  16.   * @param args the command line arguments
  17.   */
  18. public static void main(String[] args) {
  19. Scanner sc = new Scanner(System.in);
  20. String res = sc.nextLine();
  21. String[] ress = res.split(" ");
  22. int pom, m, p, l, e, r, s, n;
  23. m = Integer.parseInt(ress[0]);
  24. p = Integer.parseInt(ress[1]);
  25. l = Integer.parseInt(ress[2]);
  26. e = Integer.parseInt(ress[3]);
  27. r = Integer.parseInt(ress[4]);
  28. s = Integer.parseInt(ress[5]);
  29. n = Integer.parseInt(ress[6]);
  30.  
  31. for (int i = 0; i < n; i++) {
  32. pom = m;
  33. m = Math.round(p / s);
  34. p = Math.round(l / r);
  35. l = pom*e;
  36.  
  37.  
  38. }
  39.  
  40. System.out.println(m);
  41.  
  42. }
  43. }
  44.