We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Loading...
  • Practice
  • Compete
  • Jobs
  • Leaderboard
  • Hiring developers?
  1. Practice
  2. Mathematics
  3. Fundamentals
  4. Find the Point

Find the Point

  • Problem
  • Submissions
  • Leaderboard
  • Discussions
  • Editorial

Consider two points, and . We consider the inversion or point reflection, , of point across point to be a rotation of point around .

Given sets of points and , find for each pair of points and print two space-separated integers denoting the respective values of and on a new line.

Input Format

The first line contains an integer, , denoting the number of sets of points.
Each of the subsequent lines contains four space-separated integers describing the respective values of , , , and defining points and .

Constraints

Output Format

For each pair of points and , print the corresponding respective values of and as two space-separated integers on a new line.

Sample Input

2
0 0 1 1
1 1 2 2

Sample Output

2 2
3 3

Explanation

The graphs below depict points , , and for the points given as Sample Input:

  1. find-point-0011.png
    Thus, we print and as 2 2 on a new line.
  2. find-point-1122.png
    Thus, we print and as 3 3 on a new line.

Author

HackerRank

Difficulty

Easy

Max Score

5

Submitted By

64270

Need Help?


View discussions
View editorial
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature