P17142 [GeeksforGeeks] Corners of a rectangle1848
普及-
题目描述

Consider a rectangle ABCD. Given the co-ordinates of the mid points of side AD and BC (p and q respectively) along with their length L (AD = BC = L). Find the co-ordinates of the 4 points A, B, C and D.
Example 1:
Input: L = 2, points = {{1,0},{1,2}}
Output: {{0,0},{0,2},{2,0},{2,2}}
Explanation:
Example 2:
Input: L = 2.8284, points: {{1,1}, {-1,-1}}
Output: {{-2,0},{0,-2},{0,2},{2,0}}
Explanation:
Your Task:
You don't need to read or print anything. Your task is to compelete the function findCornerPoints() which takes a vector of two points (p and q), and length l as input parameters and returns a vector containing the floor value of the corner points of the rectangle in sorted order.

Expected Time Complexity: O(1)
Expected Space Complexity: O(1)

Constraints:
1 <= L <= 10^{5}
1 <= p, q <= L

输入格式

见题面

输出格式

见题面

样例输入
L = 2, points = {{1,0},{1,2}}
样例输出
{{0,0},{0,2},{2,0},{2,2}}