Source code for submission s1103

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.  *
  11.  * @author cteam020
  12.  */
  13. public class Mosquito {
  14.  
  15. /**
  16.   * @param args the command line arguments
  17.   */
  18. public static void main(String[] args) {
  19. Scanner scan = new Scanner(System.in);
  20. while (scan.hasNextInt()){
  21. int m,p,l,e,r,s,n;
  22. m=scan.nextInt();
  23. p=scan.nextInt();
  24. l=scan.nextInt();
  25. e=scan.nextInt();
  26. r=scan.nextInt();
  27. s=scan.nextInt();
  28. n=scan.nextInt();
  29. int x=0,k;
  30. for(int i=1;i<=n;i++){
  31. k=l;
  32. l=m*e;
  33. m=(int) Math.floor(p/s);
  34. p=(int) Math.floor(k/r);
  35.  
  36.  
  37. }
  38. System.out.println(m);
  39. }
  40. }
  41. }
  42.  
  43.  
  44.