Source code for submission s671

ololo.cpp

  1. #include <iostream>
  2. #include <cstdio>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <memory.h>
  6. #include <cstring>
  7. #include <string>
  8.  
  9.  
  10. #define FOR(i,a,b) for (int i = (a); i < (b); ++i)
  11. #define FI(i,b) FOR(i,0,b)
  12. #define V(t) vector < t >
  13. #define pb push_back
  14. #define MEMS(a,b) memset((a),(b),sizeof(a))
  15. #define U unsigned
  16. #define LL long long
  17. using namespace std;
  18.  
  19.  
  20. int n,m;
  21.  
  22. int main()
  23. {
  24. int m,p,l,e,r,s,n;
  25. while (scanf("%d%d%d%d%d%d%d",&m,&p,&l,&e,&r,&s,&n)!=EOF)
  26. {
  27. LL curm=m;
  28. LL curp=p;
  29. LL curl=l;
  30. FOR(i,0,n)
  31. {
  32. LL newl=e*curm;
  33. LL newm=(curp/s);
  34. LL newp=curl/r;
  35. curm=newm;
  36. curp=newp;
  37. curl=newl;
  38. }
  39. printf("%d\n",(int)curm);
  40. }
  41. return 0;
  42. }