Source code for submission s673

Mosquito.java

  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. import java.io.BufferedReader;
  7. import java.io.IOException;
  8. import java.io.InputStreamReader;
  9.  
  10. /**
  11.  *
  12.  * @author cteam095
  13.  */
  14. public class Mosquito {
  15.  
  16. public static void main(String[] args) throws IOException {
  17.  
  18. String inputLine = br.readLine();
  19.  
  20. while (inputLine != null) {
  21.  
  22.  
  23. String[] cisla = inputLine.split(" ");
  24.  
  25. int M = Integer.parseInt(cisla[0]);
  26. int P = Integer.parseInt(cisla[1]);
  27. int L = Integer.parseInt(cisla[2]);
  28. int E = Integer.parseInt(cisla[3]);
  29. int R = Integer.parseInt(cisla[4]);
  30. int S = Integer.parseInt(cisla[5]);
  31. int N = Integer.parseInt(cisla[6]);
  32.  
  33. int temp = L;
  34.  
  35. L = M * E;
  36. M = P / S;
  37. P = temp / R;
  38.  
  39.  
  40. for (int i = 1; i < N; i++) {
  41.  
  42. temp = L;
  43. L = M * E;
  44. M = P / S;
  45. P = temp / R;
  46.  
  47.  
  48. }
  49.  
  50. System.out.println(M);
  51. inputLine = br.readLine();
  52.  
  53. }
  54. }
  55. }
  56.