Source code for submission s1016

mosquito.c

  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int M, P, L, E, R, S, N;
  6.  
  7. int i, M2;
  8.  
  9.  
  10. while (scanf("%d %d %d %d %d %d %d", &M, &P, &L, &E, &R, &S, &N) != EOF){
  11. for (i = 0; i< N; i++){
  12.  
  13. M2 = M;
  14.  
  15. M = P/ S;
  16. P = L/ R;
  17. L = M2 * E;
  18. //printf("%d: %d %d %d\n", i, M, P, L);
  19.  
  20. if(M == 0 && P==0 && L==0){break;}
  21.  
  22. }
  23. printf("%d\n", M);
  24.  
  25.  
  26.  
  27. }
  28.  
  29.  
  30.  
  31.  
  32.  
  33. return 0;
  34. }
  35.