output_description: For each query, print the coordinate of the reflection point x. The output
  values should be in a decimal fraction with an error less than 0.00000001.
input_description: xp1 yp1 xp2 yp2
      q
      xp0 yp0
      xp1 yp1
      ...
      xpq−1 ypq−1
      
  
  In the first line, integer coordinates of p1 and p2 are given. Then, q queries
  are given for integer coordinates of p.
attempt: import math
  
  
  class Point:
      def __init__(self, x, y):
          self.x = x
          self.y = y
  
      def __add__(self, a):
          return self.__class__(self.x + a.x, self.y + a.y)
  
      def __sub__(self, a):
          return self.__class__(self.x - a.x, self.y - a.y)
  
      def __mul__(self, d):
          return self.__class__(self.x * d, self.y * d)
  
      def __truediv__(self, d):
          return self.__class__(self.x / d, self.y / d)
  
      def __str__(self):
          return "%.10f %.10f" % (self.x, self.y)
  
      def abs(self):
          return self.norm() ** (1.0 / 2.0)
  
      def norm(self):
          return self.x * self.x + self.y * self.y
  
      def rotate(self, d):
          r = math.pi * d / 180.0
          return self.__class__(
              self.x * math.cos(r) - self.y * math.sin(r),
              self.x * math.sin(r) + self.y * math.cos(r),
          )
  
      def dot(self, p):
          return self.x * p.x + self.y * p.y
  
  
  class Segment:
      def __init__(self, p1, p2):
          self.p1 = p1
          self.p2 = p2
  
  
  def project(s, p):
      v = s.p2 - s.p1
      r = v.dot(p - s.p1) / v.norm()
      return s.p1 + v * r
  
  
  def reflect(s, p):
      return p + (project(s, p) - p) * 2.0
  
  
  def main():
      a, b, c, d = map(float, input().split())
      s = Segment(Point(a, b), Point(c, d))
      q = int(input())
      for _ in range(q):
          e, f = map(float, input().split())
          p = Point(e, f)
          print(reflect(s, p))
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Reflection
  
    
  
  For given three points p1, p2, p, find the reflection point x of p onto p1p2.
  
  ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_CGL_CGL_1_B)
samples: [{"input": "0 0 2 0\n    3\n    -1 1\n    0 1\n    1 1", "output": "-1.0000000000 -1.0000000000\n    0.0000000000 -1.0000000000\n    1.0000000000 -1.0000000000"}, {"input": "0 0 3 4\n    3\n    2 5\n    1 4\n    0 3", "output": "4.2400000000 3.3200000000\n    3.5600000000 2.0800000000\n    2.8800000000 0.8400000000"}]