Language: C++

#include <numeric>
#include <iomanip>
typedef std::vector<double> VecD;
#define rep(n) for(int i=0;i<n;i++)
#define PB push_back

class Point;
// void send(FILE* f, char* p, int n);
// void send(std::ostream* f, char* p, int n);
const Point projection(const Point &p1, const Point &p2);

class Point{
friend const double operator*(const Point&, const Point&);
template <class T> friend const Point operator*(const T&, const Point&);
template <class T> friend const Point operator*(const Point&, const T&);
friend const Point operator+(const Point&, const Point&);
template <class T> friend const Point operator+(const T&, const Point&);
template <class T> friend const Point operator+(const Point&, const T&);
friend const Point operator-(const Point&);
friend const Point operator-(const Point&, const Point&);
template <class T> friend const Point operator-(const T&, const Point&);
template <class T> friend const Point operator-(const Point&, const T&);
// template <class W> friend W& operator<<(W&, const Point&);
friend std::ostream& operator<<(std::ostream&, const Point&);

public:
	Point(){};
	Point(VecD v){
		point = v;
	}
	VecD point;
};

const double operator*(const Point &p0, const Point &p1){ return inner_product( p0.point.begin(), p0.point.end(), p1.point.begin(), 0); }
template <class T>
const Point operator*(const T &a, const Point &p1){
	VecD v;
	for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++) v.PB(*iter1 * a);
	const Point p(v);
	return p;
}
template <class T>
const Point operator* (const Point &p, const T &a){return a*p;}
const Point operator+(const Point &p0, const Point &p1){
	VecD v;
	VecD::const_iterator iter0 = p0.point.begin();
	for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++){
		v.PB(*iter0 + *iter1);
		iter0++;
	}
	const Point p(v);
	return p;
}
template <class T>
const Point operator+(const T &a, const Point &p1){
	VecD v;
	for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++){
		v.PB(*iter1 + a);
	}
	const Point p(v);
	return p;
}
template <class T>
const Point operator+(const Point &p1, const T &a){return a+p1;}
const Point operator-(const Point &p1){return (-1)*p1;}
const Point operator-(Point &p0, Point &p1){ return p0+(-p1); }
template <class T>
const Point operator-(const T &a, Point &p1){ return a+(-p1); }
template <class T>
const Point operator-(Point &p1, const T &a){return (-a)+p1;}

// template <class W>
// W& operator<<(W& w, const Point& p){
// 	for(VecD::const_iterator iter=p.point.begin(); iter!=p.point.end(); iter++){
// 		char c[8];
// 		sprintf(c, "%lf", *iter);
// 		send(w, c, 1);
// 	}
// 	return w;
// }

const Point projection(const Point &p1, const Point &p2){
	// cout << p1*p2 << endl;
	return ((p1*p2) / (p1*p1)) * p1;
}

std::ostream& operator<<(std::ostream &os, const Point &p){
	os << std::fixed << std::setprecision(10) << p.point[0] << " " << std::fixed << std::setprecision(10) << p.point[1] << std::endl;
}
// void send(FILE* f, char* p, int n){
// 	for (int i=0; i<n; i++){
// 		fputs(p++, f);
// 	}
// }
// void send(std::ostream* o, char* p, int n){
// 	for (int i=0; i<n; i++){
// 		// fputs(p++, f);
// 		o << *p;
// 	}
// }

#include <iostream>
#include <vector>
using namespace std;

int main(void){
	double xp0, yp0, xp1, yp1; cin >> xp0 >> yp0 >> xp1 >> yp1;
	unsigned int q; cin >> q;
	VecD v0; v0.PB(xp0); v0.PB(yp0); Point p0(v0);
	VecD v1; v1.PB(xp1); v1.PB(yp1); Point p1(v1);
	Point _p0 = p0-p0;
	Point _p1 = p1-p0;
	rep(q){
		double xp2, yp2; cin >> xp2 >> yp2;
		VecD v2; v2.PB(xp2); v2.PB(yp2); Point p2(v2);
		Point _p2 = p2-p0;
		Point _ref = (projection(_p1, _p2) - _p2) * 2;
		Point ref = _ref+p2;
		cout << ref << endl;
	}
}

Compiler output:
a.cc:3:14: error: 'vector' in namespace 'std' does not name a template type
    3 | typedef std::vector<double> VecD;
      |              ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <iomanip>
  +++ |+#include <vector>
    3 | typedef std::vector<double> VecD;
a.cc:28:19: error: expected ')' before 'v'
   28 |         Point(VecD v){
      |              ~    ^~
      |                   )
a.cc:31:9: error: 'VecD' does not name a type
   31 |         VecD point;
      |         ^~~~
a.cc: In function 'const double operator*(const Point&, const Point&)':
a.cc:34:84: error: 'const class Point' has no member named 'point'; did you mean 'Point'?
   34 | const double operator*(const Point &p0, const Point &p1){ return inner_product( p0.point.begin(), p0.point.end(), p1.point.begin(), 0); }
      |                                                                                    ^~~~~
      |                                                                                    Point
a.cc:34:102: error: 'const class Point' has no member named 'point'; did you mean 'Point'?
   34 | const double operator*(const Point &p0, const Point &p1){ return inner_product( p0.point.begin(), p0.point.end(), p1.point.begin(), 0); }
      |                                                                                                      ^~~~~
      |                                                                                                      Point
a.cc:34:118: error: 'const class Point' has no member named 'point'; did you mean 'Point'?
   34 | const double operator*(const Point &p0, const Point &p1){ return inner_product( p0.point.begin(), p0.point.end(), p1.point.begin(), 0); }
      |                                                                                                                      ^~~~~
      |                                                                                                                      Point
a.cc:34:66: error: 'inner_product' was not declared in this scope; did you mean 'std::inner_product'?
   34 | const double operator*(const Point &p0, const Point &p1){ return inner_product( p0.point.begin(), p0.point.end(), p1.point.begin(), 0); }
      |                                                                  ^~~~~~~~~~~~~
      |                                                                  std::inner_product
In file included from /usr/include/c++/14/numeric:62,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_numeric.h:223:5: note: 'std::inner_product' declared here
  223 |     inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
      |     ^~~~~~~~~~~~~
a.cc: In function 'const Point operator*(const T&, const Point&)':
a.cc:37:9: error: 'VecD' was not declared in this scope
   37 |         VecD v;
      |         ^~~~
a.cc:38:13: error: 'VecD' is not a class, namespace, or enumeration
   38 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++) v.PB(*iter1 * a);
      |             ^~~~
a.cc:38:57: error: 'iter1' was not declared in this scope
   38 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++) v.PB(*iter1 * a);
      |                                                         ^~~~~
a.cc:38:67: error: 'const class Point' has no member named 'point'; did you mean 'Point'?
   38 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++) v.PB(*iter1 * a);
      |                                                                   ^~~~~
      |                                                                   Point
a.cc:38:88: error: 'v' was not declared in this scope
   38 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++) v.PB(*iter1 * a);
      |                                                                                        ^
a.cc:39:23: error: 'v' was not declared in this scope
   39 |         const Point p(v);
      |                       ^
a.cc: In function 'const Point operator+(const Point&, const Point&)':
a.cc:45:9: error: 'VecD' was not declared in this scope
   45 |         VecD v;
      |         ^~~~
a.cc:46:9: error: 'VecD' is not a class, namespace, or enumeration
   46 |         VecD::const_iterator iter0 = p0.point.begin();
      |         ^~~~
a.cc:47:13: error: 'VecD' is not a class, namespace, or enumeration
   47 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++){
      |             ^~~~
a.cc:47:57: error: 'iter1' was not declared in this scope
   47 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++){
      |                                                         ^~~~~
a.cc:47:67: error: 'const class Point' has no member named 'point'; did you mean 'Point'?
   47 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++){
      |                                                                   ^~~~~
      |                                                                   Point
a.cc:48:17: error: 'v' was not declared in this scope
   48 |                 v.PB(*iter0 + *iter1);
      |                 ^
a.cc:48:23: error: 'iter0' was not declared in this scope
   48 |                 v.PB(*iter0 + *iter1);
      |                       ^~~~~
a.cc:51:23: error: 'v' was not declared in this scope
   51 |         const Point p(v);
      |                       ^
a.cc: In function 'const Point operator+(const T&, const Point&)':
a.cc:56:9: error: 'VecD' was not declared in this scope
   56 |         VecD v;
      |         ^~~~
a.cc:57:13: error: 'VecD' is not a class, namespace, or enumeration
   57 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++){
      |             ^~~~
a.cc:57:57: error: 'iter1' was not declared in this scope
   57 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++){
      |                                                         ^~~~~
a.cc:57:67: error: 'const class Point' has no member named 'point'; did you mean 'Point'?
   57 |         for(VecD::const_iterator iter1=p1.point.begin();iter1!=p1.point.end();iter1++){
      |                                                                   ^~~~~
      |                                                                   Point
a.cc:58:17: error: 'v' was not declared in this scope
   58 |                 v.PB(*iter1 + a);
      |                 ^
a.cc:60:23: error: 'v' was not declared in this scope
   60 |         const Point p(v);
      |                       ^
a.cc: In function 'std::ostream& operator<<(std::ostream&, const Point&)':
a.cc:88:56: error: 'const class Point' has no member named 'point'; did you mean 'Point'?
   88 |         os << std::fixed << std::setprecision(10) << p.point[0] << " " << std::fixed << std::setprecision(10) << p.point[1] << std::endl;
      |                                                        ^~~~~
      |                                                        Point
a.cc:88:116: error: 'const class Point' has no member named 'point'; did you mean 'Point'?
   88 |         os << std::fixed << std::setprecision(10) << p.point[0] << " " << std::fixed << std::setprecision(10) << p.point[1] << std::endl;
      |                                                                                                                    ^~~~~
      |                                                                                                                    Point
a.cc:89:1: warning: no return statement in function returning non-void [-Wreturn-type]
   89 | }
      | ^
a.cc: In function 'int main()':
a.cc:109:9: error: 'VecD' was not declared in this scope
  109 |         VecD v0; v0.PB(xp0); v0.PB(yp0); Point p0(v0);
      |         ^~~~
a.cc:109:18: error: 'v0' was not declared in this scope
  109 |         VecD v0; v0.PB(xp0); v0.PB(yp0); Point p0(v0);
      |                  ^~
a.cc:110:13: error: expected ';' before 'v1'
  110 |         VecD v1; v1.PB(xp1); v1.PB(yp1); Point p1(v1);
      |             ^~~
      |             ;
a.cc:110:18: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
  110 |         VecD v1; v1.PB(xp1); v1.PB(yp1); Point p1(v1);
      |                  ^~
      |                  __pstl::execution::v1
In file included from /usr/include/c++/14/pstl/glue_numeric_defs.h:13,
                 from /usr/include/c++/14/numeric:739:
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
a.cc:115:21: error: expected ';' before 'v2'
  115 |                 VecD v2; v2.PB(xp2); v2.PB(yp2); Point p2(v2);
      |                     ^~~
      |                     ;
a.cc:115:26: error: 'v2' was not declared in this scope
  115 |                 VecD v2; v2.PB(xp2); v2.PB(yp2); Point p2(v2);
      |                          ^~