Source code for submission s957

mosquito.c

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