#P6732. Separating Two Disjoint Squares

    ID: 19940 Type: Default 1000ms 256MiB

Separating Two Disjoint Squares

Separating Two Disjoint Squares

In the two-dimensional Cartesian coordinate system, you are given two disjoint squares \(A\) and \(B\). Find any line that separates the two squares so that one square lies entirely on one side of the line and the other square lies entirely on the other side.

Note: The line must not intersect or touch either of the squares.

The squares are given by their lower-left corner coordinates and their side lengths. Let square \(A\) be defined by \((x_A, y_A)\) with side length \(L_A\), and square \(B\) by \((x_B, y_B)\) with side length \(L_B\). It is guaranteed that the squares do not overlap or touch.

Your task is to output three real numbers \(a\), \(b\), and \(c\) representing the line in the standard form \[ a x + b y + c = 0, \] which separates the squares such that all points of one square satisfy \(a x+b y+c0\).

Hint: If the squares are separated either horizontally or vertically, you might choose a vertical line (\(x=\) constant) or a horizontal line (\(y=\) constant) respectively.

inputFormat

The input consists of a single line containing six real numbers:

  1. \(x_A\) \(y_A\) \(L_A\) — the x-coordinate, y-coordinate of the lower-left corner and the side length of square \(A\),
  2. \(x_B\) \(y_B\) \(L_B\) — the x-coordinate, y-coordinate of the lower-left corner and the side length of square \(B\).

It is guaranteed that the squares are disjoint.

outputFormat

Output three real numbers \(a\), \(b\), \(c\) separated by spaces representing the line \(a x+b y+c=0\) that separates the two squares without touching either of them.

sample

0 0 1 2 0 1
1 0 -1.5