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>
using namespace std;

struct TCoordinate
{
	double x;
	double y;
};

struct TLine
{
	TCoordinate StartPoint;
	TCoordinate EndPoint;
	double GetInclination()
	{
		return (EndPoint.y - StartPoint.y) / (EndPoint.x - StartPoint.x);
	}
};

int main()
{
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		TLine AB, CD;
		cin >> AB.StartPoint.x >> AB.StartPoint.y
		    >> AB.EndPoint.x   >> AB.EndPoint.y
		    >> CD.StartPoint.x >> CD.StartPoint.y
		    >> CD.EndPoint.x   >> CD.EndPoint.y;
		if(AB.GetInclination() == CD.GetInclination()){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <queue>
#include <algorithm>
#include <cmath>

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

int n;
double x[4];
double y[4];

int main(){
	scanf("%d", &n);
	rep(i, n){
		rep(j, 4){
			scanf("%lf%lf", x + j, y + j);
		}

		double dx[2];
		double dy[2];
		dx[0] = x[0] - x[1];
		dx[1] = x[2] - x[3];
		dy[0] = y[0] - y[1];
		dy[1] = y[2] - y[3];

		// printf("(%lf, %lf) (%lf, %lf)\n", dx[0], dy[0], dx[1], dy[1]);

		printf("%s\n", dy[0] / dx[0] == dy[1] / dx[1] ? "YES" : "NO");
	}
	return 0;
}

C++: #include<stdio.h>

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

	scanf("%d",&n);
	for(int x=0;x<n;x++)
	{
		for(;;)
		{
			scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
			if(x1>100||y1>100||x2>100||y2>100||x3>100||y3>100||x4>100||y4>100)
			{
			}
			else if(x1<-100||y1<-100||x2<-100||y2<-100||x3<-100||y3<-100||x4<-100||y4<-100)
			{
			}
			else
			{
				break;
			}
		}

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

		p=x2/y2;
		q=x4/y4;

		if(p==q)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		double x[4],y[4];
		char a;
		for(int i=0;i<4;i++){
			cin>>x[i]>>a>>y[i];
		}
		if((x[0]-x[1])/(y[0]-y[1])==(x[2]-x[3])/(y[2]-y[3])){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

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

int main(){
	double x[4], y[4];
	int n, i, j;

	cin >> n;

	for(i = 0; i < n; i ++){
		for(j = 0; j < 4; j ++){
			cin >> x[j] >> y[j];
		}
		x[1] -= x[0];
		y[1] -= y[0];
		x[3] -= x[2];
		y[3] -= y[2];

		if(x[1] == 0 || x[3] == 0){
			if(x[1] == 0 && x[3] == 0){
				printf("YES\n");
			}else{
				printf("NO\n");
			}
			}else{
				if(y[1]/x[1] == y[3]/x[3]){
					printf("YES\n");
				}else{
					printf("NO\n");
			}
		}
	}
	
	return 0;    
}

C++: #include <iostream>
#include <stack>
#include <stdio.h>
#include <math.h>
using namespace std;
double x[4],y[4];//p,1,2,3
double make_line(double x1,double y1,double x2,double y2){
	double a,b,c;//ax+by+c=0
	if(x1!=x2&&y1!=y2){
		a=(y1-y2)/(x1-x2);
		b=-1;
		c=-a*x1+y1;
	}else if(x1==x2){
		a=1;
		b=0;
		c=-x1;
	}else if(y1==y2){
		a=0;
		b=1;
		c=-y1;
	}
	return a;
}
int main()
{
	int n;
	cin>>n;
	while(n--){
		cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>x[3]>>y[3];
		printf(abs(make_line(x[0],y[0],x[1],y[1])-make_line(x[2],y[2],x[3],y[3]))<=0.000001?"YES\n":"NO\n");
	}
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin>>n;
    float x1,y1,x2,y2,x3,y3,x4,y4;
    for(int i=0;i<n;i++){
        cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
        if((y2-y1)/(x2-x1)==(y4-y3)/(x4-x3)){
        cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}

C++: #include<iostream>

int main(){
  int n;
  double x1,y1,x2,y2,x3,y3,x4,y4;
  const double e = 1e-7;

  std::cin >> n;

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

    if((x1*y3+x2*y4+y2*x3+y1*x4)-(x2*y3+x1*y4+y1*x3+y2*x4)<e){
      std::cout << "YES" << std::endl;
    }else{
      std::cout << "NO" << std::endl;
    }
  }
}

C++: #include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <sstream>
#include <utility>
#include <cstdlib>
#include <cctype>
#include <climits>
#include <fstream>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<pair<int, int> > vpii;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second
using namespace std;

int main(){
	int N;
	vd a(8);
	cin >> N;
	rep(i,N){
		rep(i,8){
			cin>>a[i];
		}
		if(((a[1]-a[3])*(a[4]-a[6])-(a[5]-a[7])*(a[0]-a[2]))*((a[1]-a[3])*(a[4]-a[6])-(a[5]-a[7])*(a[0]-a[2]))<0.000001){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}

}

C++: #include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y-1);(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  int i,j,k,T;
  cin>>T;
  while(T--){
    double xx,yy,EPS=1e-1;
    ll x[4],y[4];
    rep(i,4){
      cin>>xx>>yy;
      x[i]=xx*1e5+EPS;
      y[i]=yy*1e5+EPS;
      //   cout<<x[i]<<","<<y[i]<<endl;
    }cout<<1e5<<endl;
    rep(i,2){
      x[i*2+1]-=x[i*2];
      y[i*2+1]-=y[i*2];
    }
    cout<<(x[1]*y[3]==x[3]*y[1]?"YES":"NO")<<endl;
  }
  return 0;
}