Source code for submission s810

mosq.java

  1.  
  2. import java.io.BufferedReader;
  3.  
  4. /*
  5.  * To change this template, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8. import java.io.IOException;
  9. import java.io.InputStreamReader;
  10. import java.util.ArrayList;
  11. import java.util.LinkedList;
  12. import java.util.StringTokenizer;
  13.  
  14.  
  15.  
  16. /**
  17.  *
  18.  * @author cteam022
  19.  */
  20. public class mosq {
  21.  
  22.  
  23. /**
  24.   * @param args the command line arguments
  25.   */
  26. public static void main(String[] args) throws IOException {
  27. mosq g = new mosq();
  28. while(true){g.uloha();}
  29. }
  30.  
  31. void uloha() throws IOException{
  32. if(!input.ready()){System.exit(0);}
  33. st = new StringTokenizer(input.readLine());
  34. int M = Integer.valueOf(st.nextToken());
  35. int P = Integer.valueOf(st.nextToken());
  36. int L = Integer.valueOf(st.nextToken());
  37. int E = Integer.valueOf(st.nextToken());
  38. int R = Integer.valueOf(st.nextToken());
  39. int S = Integer.valueOf(st.nextToken());
  40. int N = Integer.valueOf(st.nextToken());
  41.  
  42. int C[] = new int[N+1];
  43.  
  44. C[0] = M;
  45. C[1] = P/S;
  46. C[2] = L/(R*S);
  47. for(int i = 3; i <= N; i++) {
  48. C[i] = (E*C[i-3])/(R*S);
  49. }
  50. System.out.println(C[N]);
  51. }
  52.  
  53. }
  54.