Source code for submission s831

Mosquito.java

  1.  
  2. import java.util.StringTokenizer;
  3. import java.io.BufferedReader;
  4. import java.io.InputStreamReader;
  5.  
  6. /**
  7.  *
  8.  * @author cteam049
  9.  */
  10. public class Mosquito {
  11.  
  12. protected int Msouc, Mpred;
  13. protected int Psouc, Ppred;
  14. protected int Lsouc, Lpred;
  15. protected int E;
  16. protected int R;
  17. protected int S;
  18. protected int N;
  19.  
  20. /**
  21.   * @param args the command line arguments
  22.   */
  23. public static void main(String[] args) {
  24. Mosquito program = new Mosquito();
  25. program.run();
  26. }
  27.  
  28. protected void run() {
  29. try {
  30. for ( ;; )
  31. {
  32. nacteni();
  33.  
  34.  
  35.  
  36. for (int i = 0; i < N; i++) {
  37. Mpred = Msouc;
  38. Ppred = Psouc;
  39. Lpred = Lsouc;
  40.  
  41.  
  42.  
  43. Lsouc = Mpred * E;
  44. Psouc= Lpred/R;
  45. Msouc = Ppred/S;
  46.  
  47.  
  48. }
  49. System.out.println(Msouc);
  50. }
  51. } catch (Exception e) {
  52. e.printStackTrace();
  53. }
  54. }
  55.  
  56. protected void nacteni() throws Exception {
  57. Msouc = nextInt();
  58. Psouc = nextInt();
  59. Lsouc = nextInt();
  60. E = nextInt();
  61. R = nextInt();
  62. S = nextInt();
  63. N = nextInt();
  64. }
  65. /* INPUT READING */
  66.  
  67. public String nextToken() throws Exception {
  68. while (!st.hasMoreTokens()) {
  69. st = new StringTokenizer(input.readLine());
  70. }
  71. return st.nextToken();
  72. }
  73.  
  74. public int nextInt() throws Exception {
  75. return Integer.parseInt(this.nextToken());
  76. }
  77.  
  78. public String nextLine() throws Exception {
  79. return input.readLine();
  80. }
  81. }
  82.