Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. #ifndef ABC
  2. #define _CRT_SECURE_NO_WARNINGS
  3. #include <iostream>
  4. #include <string>
  5. #include <map>
  6. #include <vector>
  7. #include <algorithm>
  8. #include <math.h>
  9. #include <set>
  10. #include <queue>
  11. #include <stack>
  12. #include <list>
  13. #define endl '\n'
  14. #define ABS(x) (((x)^((x) >> 31)) - ((x) >> 31))
  15. #include <ctime>
  16. using namespace std;
  17.  
  18. typedef long long ll;
  19. typedef pair<ll, ll> pi;
  20. typedef pair<pi, ll> ppi;
  21. typedef vector<ll> vi;
  22. typedef vector<vi> vvi;
  23. typedef vector<pi> vpi;
  24. typedef vector<vpi> vvpi;
  25. typedef vector<ppi> vppi;
  26. typedef vector<bool> vb;
  27. typedef map<ll, ll> mii;
  28. typedef set<pi> spi;
  29. typedef set<ll> si;
  30. typedef multiset<ll> msi;
  31. typedef multiset<pi> mspi;
  32. typedef vector<si> vsi;
  33. template <typename T> using V = vector<T>;
  34. template <typename T> using VV = vector<V<T>>;
  35. template <typename T> using Mi = map<ll, T>;
  36. template <typename T> using MMi = map<ll, Mi<T>>;
  37.  
  38. const double PI = 3.141592653589793238463;
  39. #endif // ABC
  40.  
  41.  
  42.  
  43.  
  44. void cinArr(vi &arr) {
  45. for (int i = 0; i < arr.size(); i++) {
  46. cin >> arr[i];
  47. }
  48. }
  49.  
  50.  
  51. int main()
  52. {
  53. ios_base::sync_with_stdio(false);
  54. cin.tie(0);
  55. cout.tie(0);
  56. cout.precision(15);
  57.  
  58. ll a, b;
  59. cin >> a >> b;
  60. /*
  61. long double time = 0;
  62. ll N = 1e7;
  63. ll mn = 100;
  64. srand(unsigned(std::time(0)));
  65. for (int i = 0; i < N; i++) {
  66. ll x1, x2, y1, y2;
  67. x1 = rand() % (a*mn+ 1);
  68. x2 = rand() % (a*mn + 1);
  69. y1 = rand() % (b*mn + 1);
  70. y2 = rand() % (b*mn + 1);
  71. time += abs(x1 - x2) + abs(y1 - y2);
  72. }
  73. long double ans = time / (N*mn);
  74. cout << ans;
  75. */
  76. cout <<fixed << (a+b)/3.0;
  77. //2 2 = 4/3
  78. //1 1 = 2/3
  79. //1 2 = 1
  80. //2 3 = 1.67? 5/3
  81. //1 4 = 1.67? 5/3
  82. return 0;
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement