Source code for submission s752

mosquito.cpp

  1. #include <stdio.h>
  2. #include <iostream>
  3. using namespace std;
  4. void solve(int M,int P,int L,int E,int R,int S,int N){
  5. int M2,P2,L2;
  6. for(int i=0;i<N;i++){
  7. //cout<<M<<" "<<P<<" "<<L<<endl;
  8. M2=P/S;
  9. P2=L/R;
  10. L2=M*E;
  11. M=M2;
  12. P=P2;
  13. L=L2;
  14. }
  15. printf("%d\n",M);
  16. }
  17. int main(){
  18. int M,P,L,E,R,S,N;
  19. while (scanf("%d %d %d %d %d %d %d", &M, &P, &L, &E,&S, &R,&N) == 7){
  20. solve(M,P,L,E,R,S,N);
  21. }
  22. return 0;
  23. }
  24.