Go: package main

import "fmt"

func abs(x float64) float64 {
	if x < 0 {
		return -x
	}
	return x
}

func main() {
	var n int
	var x1, y1, x2, y2, x3, y3, x4, y4 float64
	fmt.Scan(&n)
	for i := 0 ; i < n; i++ {
		fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)
		if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < 1e-10 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <cmath>
#include <sstream>
#define F first
#define S second
#define FOR(i,n) for(int i=0;i<(int)n;i++)
#define FORI(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int l = 0; l < n; l++) {
		double x[4], y[4];
		for (int i = 0; i < 4; i++)cin >> x[i] >> y[i];
		if (x[0] == x[1] && x[2] == x[3]) {
			cout << "YES" << endl;
			continue;
		} else if ((y[1] - y[0]) / (x[1] - x[0]) == (y[3] - y[2]) / (x[3] - x[2])) {
			cout << "YES" << endl;	
			continue;
		}
		cout << "NO" << endl;
		continue;
	}

}

#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <cmath>
#include <sstream>
#define F first
#define S second
#define FOR(i,n) for(int i=0;i<(int)n;i++)
#define FORI(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int l = 0; l < n; l++) {
		double x[4], y[4];
		for (int i = 0; i < 4; i++)cin >> x[i] >> y[i];
		if (x[0] == x[1] && x[2] == x[3]) {
			cout << "YES" << endl;
			continue;
		} else if ((y[1] - y[0]) / (x[1] - x[0]) == (y[3] - y[2]) / (x[3] - x[2])) {
			cout << "YES" << endl;	
			continue;
		}
		cout << "NO" << endl;
		continue;
	}

}

C++: #include<iostream>
#include<cstdio>
 
using namespace std;
 
int main(){
    double x1,y1,x2,y2,x3,y3,x4,y4;
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
        x2-=x1; y2-=y1;
        x4-=x3; y4-=y3;
        if(x2*y4-y2*x4==0) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}

C++: #include <stdio.h>

int main(){
	int num;
	double x1, y1;
	double x2, y2;
	double x3, y3;
	double x4, y4;
	double ax, ay;
	double bx, by;
	float s;
				
	scanf("%d", &num);	
	for(int i = 0; i < num; i++){
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);

		ax = x2 - x1;
		ay = y2 - y1;
		bx = x4 - x3;
		by = y4 - y3;
		s = ax*by - ay*bx;
		if(s == 0.0){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	
	return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
  double x1,y1,x2,y2,x3,y3,x4,y4;
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
    if((y1-y2)/(x1-x2) == (y3-y4)/(x3-x4))cout<<"YES"<<endl;
    else cout<<"NO"<<endl;}
    return 0;

}

C++: #include<iostream>
#include<cmath>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int n;
	pair<long double,long double> p[4],vec[2];
	cin>>n;
	rep(j,n){
		rep(i,4)cin>>p[i].first>>p[i].second;
		rep(i,2){
			vec[i].first=p[i*2].first-p[i*2+1].first;
			vec[i].second=p[i*2].second-p[i*2+1].second;
		}
		double check=vec[0].first*vec[1].second-vec[0].second*vec[1].first;
		if(abs(check)<1e-10)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
    cout << "In preparation.";
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

int main() {

  int n; cin >> n;

  while (n--) {

    Real x1,y1,x2,y2,x3,y3,x4,y4;
    cin >> x1 >> y1 >> x2 >> y2;
    cin >> x3 >> y3 >> x4 >> y4;

    x1 -= x2;
    y1 -= y2;
    x3 -= x4;
    y3 -= y4;

    if (abs(x1 * y3 - y1 * x3) < 1e-8) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }

  }

  return 0;
}

C++: #include <stdio.h>

#include <math.h>

int hantei(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4);

int main(){
    
	double x1,x2,x3,x4,y1,y2,y3,y4;
    
	int result=0,i,n;
    
	scanf("%d",&n);
    
	for(i=0;i<n;i++){
        
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
        
		result= hantei(x1,y1,x2,y2,x3,y3,x4,y4);
        
		if(result==1){
            
			puts("YES");
            
		}else puts("NO");
        
	}
    
    
    
    
    
    return 0;
    
}

int hantei(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
    
	double kata1,kata2;
    
	kata1=(y1-y2)/(x1-x2);
    
	kata2=(y3-y4)/(x3-x4);
    
	if(kata1==kata2){
        
		return 1;
        
	}else{
        
		return 0;
        
	}
    
    
    
}

C++: #include<iostream>

using namespace std;

bool get_inc( double x1 , double y1 , double x2 , double y2 , double& a );

int main(void)
{
	double x1, x2, x3, x4;
	double y1, y2, y3, y4;

	double a1, a2;

	int n;

	cin >> n;

	for( int i = 0 ; i < n ; i++ )
	{
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

		bool result1 = get_inc( x1 , y1 , x2 , y2 , a1 );
		bool result2 = get_inc( x3 , y3 , x4 , y4 , a2 );

		if( result1 == false && result2 == false )
		{
			cout << "YES" << endl;
		}
		else
		{
			if( a1 - a2 == 0 ) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
	}


	return 0;
}

bool get_inc( double x1 , double y1 , double x2 , double y2 , double& a )
{
	a = ( y2 - y1 )/( x2 - x1 );
	if( x2 - x1 >= -0.0000001 && x2 - x1 <= 0.0000001 )
	{
		return false;
	}
	return true;
}

C++: #include<iostream>
using namespace std;
int main(){
    int x;
    cin >> x;
    while(x--){
        float x1,x2,x3,x4,y1,y2,y3,y4;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
        float a = (y1-y2)*(x3-x4);
        float b = (y3-y4)*(x1-x2);
        if(a==b)    cout << "YES\n";
        else    cout << "NO\n";
    }
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

int main(){
	int n;
	cin >> n;
	string s;
	while(cin >> s){
		size_t p = s.find('.');
		if(p != string::npos && s.size() - p >= 7){
			throw 0;
		}
	}
}