fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define el "\n"
  4. #define ll long long
  5. #define ull unsigned long long
  6. #define se second
  7. #define fi first
  8. #define be begin()
  9. #define en end()
  10. #define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
  11.  
  12. struct toado {
  13. double x, y;
  14. friend istream& operator >> (istream& in, toado &a)
  15. {
  16. in >> a.x >> a.y;
  17. return in;
  18. }
  19. };
  20.  
  21. double distanceSquared(toado a, toado b)
  22. {
  23. return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
  24. }
  25.  
  26. bool isParallelogram(toado a, toado b, toado c, toado d) {
  27. return distanceSquared(a, b) == distanceSquared(c, d) && distanceSquared(b, d) == distanceSquared(a, c);
  28. }
  29.  
  30. int main()
  31. {
  32. Faster;
  33. toado a, b, c, d;
  34. cin >> a >> b >> c >> d;
  35.  
  36. if (isParallelogram(a, b, c, d))
  37. {
  38. cout << "Yes" << el;
  39. }
  40. else
  41. {
  42. cout << "No" << el;
  43. }
  44. return 0;
  45. }
  46. //code by chatgpt
  47.  
Success #stdin #stdout 0.01s 5284KB
stdin
0 0 0 1 1 0 1 1
stdout
Yes