Three points of known parallelogram for fourth point

Source: Internet
Author: User

Long time ago Alex created an interesting problem about parallelogram. The input data for this problem contained four integer points on the Cartesian plane, which defined the set of vertices of Some non-degenerate (positive area) parallelogram. Points not necessary were given in the order of clockwise or counterclockwise traversal.

Alex had very nice test for this problem, but are somehow happened that the last line of the the input were lost and now he had Only three off of four points of the original parallelogram. He remembers that test is so good this he asks you to the restore it given only these three points.

Input

The input consists of three lines, each containing a pair of integer coordinates xi and Yi (?-? 1000?≤? Xi,? Yi? ≤?1000). It's guaranteed that these three points does not lie on the same line and no both of the them coincide.

Output

First print integer k -the number of ways to add one new integer point such that the obtained set defines Some parallelogram of positive area. There is no requirement for the points to being arranged in any special order (like traversal), they just define the set of V Ertices.

Then print k -lines, each containing a pair of integer-possible coordinates of the fourth point.

Example

Input
0 0
1 0
0 1
Output
3
1-1
-1 1
1 1
Code
#Include<stdio.h>#include <stdlib.h >int main  () {int x1,y1,x2,y2,x3,y3; while (scanf ( "%d%d%d%d%d%d", &X1,&Y1,&X2,&Y2,&X3,&Y3)!=eof) {printf (  "3\n"); printf ( "%d%d\n", x1+x2-x3,y1+y2-y3); printf ( "%d%d\n", x2+x3-x1,y2+y3-y1); printf ( "%d%d\n", x1+x3-x2,y1+y3-y2);} return 0;}         

Three points of known parallelogram for fourth point

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.