Facebook
From Mozahed, 3 Days ago, written in C++.
Embed
Download Paste or View Raw
Hits: 37
  1. //Bismillahir Rahmanir Rahim
  2. #include<bits/stdc++.h>
  3. #define ull unsigned long long
  4. #define ll long long
  5. #define pb push_back
  6. #define mp make_pair
  7. #define pob pop_back
  8. #define in insert
  9. #define vi vector<ll int>
  10. #define vs vector<string>
  11. #define pii pair<ll int,ll int>
  12. #define psi pair<string,ll int>
  13. #define pis pair<ll int,string>
  14. #define mii map<ll int,ll int>
  15. #define mib map<ll int,bool>
  16. #define msi map<string,ll int>
  17. #define mis map<ll int,string>
  18. #define S string
  19. #define fi first
  20. #define se second
  21. #define sp ' '
  22. #define dl "\n"
  23. #define all(data) data.begin(),data.end()
  24. #define b() begin()
  25. #define e() end()
  26. #define cY cout<<"YES\n"
  27. #define cN cout<<"NO\n"
  28. #define cy cout<<"Yes\n"
  29. #define cn cout<<"No\n"
  30. #define setp(n) setprecision(n)
  31. #define mem(arr,val) memset(arr,val,sizeof(arr));
  32. #define debug(x) cerr<<x<<dl;
  33. #define here fprintf(stderr, "====I am Here====\n");
  34. #define FOR(data) for(auto it=data.begin();it!=data.end();it++)
  35. #define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
  36. #define maxx 100005
  37. #define EPS 1e-9
  38. #define setp(n) setprecision(n)
  39. using namespace std;
  40. const double PI = acos(-1);
  41. ll int hp = 1e9+7;
  42.  
  43.  
  44.  
  45.  
  46. void Boom()
  47. {
  48.     //Let's Move
  49.  
  50.    
  51.     ll int x1,x2,x3,y1,y2,y3;
  52.     cin>>x1>>y1>>x2>>y2>>x3>>y3;
  53.  
  54.     cout<<fixed<<setp(10)<<abs(x1*(y2 - y3) - y1*(x2 - x3) + (x2*y3 - y2*x3))/2.0<<dl;
  55.  
  56.  
  57.  
  58.  
  59. }
  60.  
  61. int main()
  62. {
  63.     Boost;
  64.     freopen("area1.in", "r", stdin);
  65.     freopen("area1.out", "w", stdout);
  66.  
  67.  
  68.     int t=1;     //  cin>>t;
  69.     for(int i=1;i<=t;i++)
  70.     {
  71.         //cout<<"Case "<<i<<" : ";
  72.         Boom();
  73.     }
  74.  
  75.     return 0;
  76.  
  77. }
  78.