Source code for submission s834

mosquito.cpp

  1. #include <cstdio>
  2. using namespace std;
  3.  
  4. int main() {
  5. int M,P,L,E,R,S,N;
  6. int E_o,E_n, P_n, P_o, L_o, L_n, M_o, M_n, i;
  7.  
  8. while(scanf("%d %d %d %d %d %d %d", &M, &P, &L,&E, &R, &S, &N) == 7) {
  9. E_o=0;
  10. P_o=P;
  11. L_o=L;
  12. M_o=M;
  13. i=0;
  14.  
  15. for (; i < N; i++) {
  16. P_n=L_o/R;
  17. M_n=P_o/S;
  18. E_n=M_o*E;
  19. L_n=E_n;
  20.  
  21. E_o=E_n;
  22. P_o=P_n;
  23. L_o=L_n;
  24. M_o=M_n;
  25. }
  26.  
  27. printf("%d\n", M_o);
  28. }
  29. return 0;
  30. }
  31.