Source code for submission s628

mosquito.cpp

  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include <cstring>
  4.  
  5. #include <cmath>
  6. #include <iostream>
  7. #include <algorithm>
  8.  
  9. #include <vector>
  10. #include <string>
  11. #include <map>
  12. #include <queue>
  13. #include <deque>
  14. #include <stack>
  15. #include <set>
  16.  
  17. using namespace std;
  18.  
  19. typedef unsigned int uint;
  20. typedef long double num;
  21. typedef long long int lint;
  22. typedef struct { int x, y; } intpoint;
  23. typedef struct { num x, y; } numpoint;
  24. typedef struct { lint x, y; } lintpoint;
  25.  
  26. #define EPS (1e-7L)
  27. #define PI (4.0L * atanl(1.0L))
  28.  
  29. #define min(a, b) ((a) < (b) ? (a) : (b))
  30. #define max(a, b) ((a) > (b) ? (a) : (b))
  31. #define abs(a) ((a) < 0 ? -(a) : (a))
  32.  
  33. int main(int argc, char *argv[])
  34. {
  35. uint m = 0,p = 0,l = 0,e = 0,r = 0,s = 0,n = 0;
  36.  
  37. while (cin >> m >> p >> l >> e >> r >> s >> n)
  38. {
  39. //cout << "Debug" << m << " " << p << " " << l << " " << e << " " << r << " " << s << " " << n << endl;
  40.  
  41. for ( register uint i = 0; i < n; i++ )
  42. {
  43. uint temp = m;
  44. if ( p != 0)
  45. m = ( p / s );
  46. else m = 0;
  47.  
  48. if ( l != 0 )
  49. p = ( l / r );
  50. else p = 0;
  51.  
  52. l = e * temp;
  53. }
  54.  
  55. cout << m << endl;
  56. }
  57.  
  58. return 0;
  59. }
  60.