SHARE
TWEET

Untitled

lalalalalalalaalalla Jun 26th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <iomanip>
  5. #include <queue>
  6. #include <cmath>
  7. #include <algorithm>
  8. #include <tuple>
  9. #include <iomanip>
  10. #include <stdio.h>
  11. #include <numeric>
  12. #include <map>
  13. #include <math.h>
  14.  
  15. #define int long long
  16. #define double double
  17. #define ull unsigned long long
  18. #define all(a) a.begin(), a.end()
  19. #define pii pair<int, int>
  20. #define pb push_back
  21.  
  22. using namespace std;
  23.  
  24. signed main()
  25. {
  26.     ios_base::sync_with_stdio(0);
  27.     cin.tie(0);
  28.     cout.tie(0);
  29.     cout << fixed << setprecision(1);
  30.     vector<pair<int, int>> a(3);
  31.     for (int i = 0; i < 3; i++) {
  32.         cin >> a[i].first >> a[i].second;
  33.     }
  34.     sort(all(a));
  35. //    for (int i = 0 ; i < 3; i++) {
  36. //        cout << a[i].first << " " << a[i].second << "\n";
  37. //    }
  38.     int ans = (a[2].first - a[1].first) * (a[2].second - a[1].second) + (a[2].first - a[0].first) * (a[2].second - a[0].second);
  39.     if (ans < 0) {
  40.         ans = -ans;
  41.     }
  42.     cout << ans / 2;
  43.     if (ans % 2) {
  44.         cout << ".5";
  45.     }
  46. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top