Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	n := nextInt()
	for i := 0; i < n; i++ {
		scanner.Scan()
		points := strings.Split(scanner.Text(), " ")
		fpoints := make([]float64, 0)
		for _, v := range points {
			tmp, _ := strconv.ParseFloat(v, 64)
			fpoints = append(fpoints, tmp)
		}
		if fpoints[0] == fpoints[2] && fpoints[4] == fpoints[6] {
			fmt.Println("YES")
		} else {
			a := (fpoints[1] - fpoints[3]) / (fpoints[0] - fpoints[2])
			b := (fpoints[5] - fpoints[7]) / (fpoints[4] - fpoints[6])
			if a == b {
				fmt.Println("YES")
			} else {
				fmt.Println("NO")
			}
		}
	}
}

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

#define PRINT(STR) cout << STR << endl;
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()

typedef long long ll;

using namespace std;

int nextInt() { int n = -1; cin >> n; return n; }
double nextDouble() { double d = -1; cin >> d; return d; }
ll nextll() { ll n = -1; cin >> n; return n; }
string nextString() { string str; cin >> str; return str; }

int INF = 9999999;
double EPS = 1e-9;
// BEGIN //////////////////////////////////////////////////////////////


int main() {
	int N;
	cin >> N;
	double x1, y1, x2, y2, x3, y3, x4, y4;
	REP(i, N) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

		if (x2 - x1 < EPS || x4 - x3 < EPS) {
			if (y2 - y1 < EPS && y4 - y3 < EPS) {
				PRINT("YES");
			} else {
				PRINT("NO");
			}
		} else {
			if ((y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3) < EPS) {
				PRINT("YES");
			} else {
				PRINT("NO");
			}
		}
	}

	return 0;
}

// END   //////////////////////////////////////////////////////////////

C++: #include<iostream>
using namespace std;
 
char changeSmallToLarge(char str){
 
    if(str>='a' && str<='z'){
        return str - 32;
    }
    else{
        return str;
    }
}
 
int main(){
     
    char str[1000];
 
    cin.getline(str,1000);
 
    for(int i=0;str[i]!='\0';i++){
        str[i] = changeSmallToLarge(str[i]);
    }
 
    cout<<str<<endl;
 
    return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){
	
	vector<double> x(4);
	vector<double> y(4);
	for(int i=0;i<4;i++){
		cin>> x[i]>> y[i];
	}
	double a,b;
	a = (y[1]-y[0]) / (x[1]-x[0]);
	b = (y[3]-y[2]) / (x[3]-x[2]);
	
	if(a==b){
		cout<< "YES"<< endl;
	}else{
		cout<< "NO"<< endl;
	}
	

	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	int n;
	cin>> n;
	for(int i=0;i<n;i++){
		solve();
	}

	return 0;
}

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<cmath>
#include<cstdlib>
#include<string>
#include<algorithm>
using namespace std;

int main(){
	int n;
	scanf("%d",&n);
	for(int x=0;x<n;++x){
		float m1,m2;
		float x1,x2,y1,y2;
		scanf("%f %f %f %f",&x1,&y1,&x2,&y2);
		m1 = (y2-y1)/(x2-x1);
		scanf("%f %f %f %f",&x1,&y1,&x2,&y2);
		m2 = (y2-y1)/(x2-x1);
		if(m1==m2){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <climits>
using namespace std;

int main(){
    double EPS = 1e-12;
    double x[4], y[4];
    int s,t,u,v;
    int n;
    cin >> n;
    for (int t = 0;t < n;++t) {
        for (int i = 0;i < 4;++i){
            cin >> x[i] >> y[i]; 
        }
    }
    s = x[1] - x[0];
    t = y[1] - y[0];
    u = x[3] - x[2];
    v = y[3] - y[2];
    if(s * v - t * u > 0){
        double m = s * v - t * u;
    }
    else{
        double m = t * u - s * v;
    }
    if( m < EPS){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    return 0;
}

C++: #include <stdio.h>

int main(){
  int n;
  scanf("%d", &n);

  for(int i=0;i<n;i++){
    double x1, y1, x2, y2, x3, y3, x4, y4;
    scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1,&y1,&x2,&y2,&x3, &y3,&x4, &y4);

    double ab = (y1-y2)/(x1-x2);
    double cd = (y3-y4)/(x3-x4);

    printf("%s\n", (ab==cd)? "YES":"NO");
  }
  return 0;
}

C++: #include<iostream>
#include<cmath>
#include<cassert>
#include<cstdlib>
using namespace std;
#define EPS 0.0000001
 
 
int main(){
  int tcase;   cin >> tcase;
  double x1, y1, x2, y2, x3, y3, x4, y4;
  for ( int i = 0; i < tcase; i++ ){
      cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
 
   
      if ( abs((y2 - y1)*(x4 - x3) - (y4 - y3)*(x2 - x1) ) < EPS ) cout << "YES" << endl;
      else cout << "NO" << endl;
  }
  return 0;
}

C++: 
#include <iostream>
#include <complex>

using namespace std;

typedef complex<double> Point;

int main() {
    int N;
    cin >> N;
    while(N--) {
        Point ps[4];
        for(int i = 0; i < 4; ++i) cin >> ps[i].real() >> ps[i].imag();
        Point v1 = ps[1]-ps[0], v2 = ps[3]-ps[2];
        double dot = v1.real()*v2.real() + v1.imag()*v2.imag();
        double n = norm(v1) * norm(v2);
        if(abs(dot*dot - n) < 1e-4) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(int argc, char* argv[]){
	vector<string> result;
	double x1,y1,x2,y2,x3,y3,x4,y4;
	int N = 0;
	cin >> N;
	for (int i=0; i<N; ++i){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		double inc1,inc2;
		inc1 = (y1 - y2) / (x1 - x2);
		inc2 = (y3 - y4) / (x3 - x4);
		if (inc1 == inc2){
			result.push_back("YES");
		}
		else{
			result.push_back("NO");
		}
	}
	vector<string>::iterator it = result.begin();
	while (it != result.end()){
		cout << *it << endl;
		++it;
	}
	return 0;
}

C++: //
//  main.cpp
//  main
//
//  Created by h3037175 on 2018/01/22.
//  Copyright © 2018年 h3037175. All rights reserved.
//

#include<iostream>
#include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
#include<utility>
using namespace std;
double zeti(double);
int main() {
    pair<double,double> a;
    pair<double,double> b;
    pair<double,double>c;
    pair<double,double>d;
    int n;
    double s1,s2;
    cin>>n;
    for(int i=0;i<n;++i){
        cin>>a.first>>a.second>>b.first>>b.second>>c.first>>c.second>>d.first>>d.second;
        if(a.first==b.first&&c.first==d.first){
            cout<<"YES"<<endl;
            continue;
        }
        else if((a.first==b.first)||(c.first==d.first)){
            cout<<"NO"<<endl;
            continue;
        }
        s1=(a.second-b.second)/(a.first-b.first);
        s2=(c.second-d.second)/(c.first-d.first);
        if(s1==s2){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    
    
    return 0;
}

C++: #include<iostream>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<algorithm>

using namespace std;

int main(void)
{
  double x=0.0,y=0.0;
  double x1=0.0,y1=0.0;
  int n=0;
  int i=0;
  double a,b;

  cin>>n;

  for(i=0;i<n;i++)
    {
      cin>>x>>y>>x1>>y1;
      if(x>x1)
        swap(x,x1);
      if(y>y1)
        swap(y,y1);
      a=(y1-y)/(x1-x);

      cin>>x>>y>>x1>>y1;
      if(x>x1)
        swap(x,x1);
      if(y>y1)
        swap(y,y1);;
      b=(y1-y)/(x1-x);
	
      if(a==b)
        puts("YES");
      else
        puts("NO");
    }

}