Source code for submission s591

main.cpp

  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.  
  9. int M, P, L, E, R, S, N;
  10. int mos, pup, lar, newlar;
  11.  
  12. while (cin >> M >> P >> L >> E >> R >> S >> N)
  13. {
  14.  
  15. mos = M; pup = P; lar = L;
  16.  
  17. while (N--)
  18. {
  19. newlar = mos * E;
  20. mos = pup / S;
  21. pup = lar / R;
  22. lar = newlar;
  23.  
  24. }
  25.  
  26. cout << mos << endl;
  27.  
  28. }
  29.  
  30. return 0;
  31. }
  32.