Language: C++

#include<algorithm>
using namespace std;
int main() {
	int n,i;
	double x1, y1, x2, y2, x3, y3, x4, y4,a,b;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		if (x1 - x2 == 0 && x3 - x4 == 0) {
			cout << "YES" << endl;
		}
		else if (x1 - x2 == 0 || x3 - x4 == 0) {
			cout << "NO" << endl;
		}
		else {
			a = (x3 - x4)*(y1 - y2);
			b = (x1 - x2)*(y3 - y4);
			if (a == b) {
				cout << "YES" << endl;
			}
			else if (a != b) {
				cout << "NO" << endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> n;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<algorithm>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:10:25: error: 'cout' was not declared in this scope
   10 |                         cout << "YES" << endl;
      |                         ^~~~
a.cc:10:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:42: error: 'endl' was not declared in this scope
   10 |                         cout << "YES" << endl;
      |                                          ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<algorithm>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:13:25: error: 'cout' was not declared in this scope
   13 |                         cout << "NO" << endl;
      |                         ^~~~
a.cc:13:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:41: error: 'endl' was not declared in this scope
   13 |                         cout << "NO" << endl;
      |                                         ^~~~
a.cc:13:41: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:19:33: error: 'cout' was not declared in this scope
   19 |                                 cout << "YES" << endl;
      |                                 ^~~~
a.cc:19:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:50: error: 'endl' was not declared in this scope
   19 |                                 cout << "YES" << endl;
      |                                                  ^~~~
a.cc:19:50: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:22:33: error: 'cout' was not declared in this scope
   22 |                                 cout << "NO" << endl;
      |                                 ^~~~
a.cc:22:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:49: error: 'endl' was not declared in this scope
   22 |                                 cout << "NO" << endl;
      |                                                 ^~~~
a.cc:22:49: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'