#P2067. Cytus-Holyknight

Cytus-Holyknight

Description

Given, in image form, several points on a straight line (all are integer points and none lie on the coordinate axes), output the equation of the line in one of the following forms (where kk and bb are constants):

  • y=kx+by=kx+b
  • y=kxy=kx
  • y=by=b
  • x=bx=b

Input Format

The first line contains a positive integer nn, indicating the size of the figure is n×nn\times n.

The next nn lines each contain nn characters. Character '1' marks the coordinate axes, 'x' indicates that the integer point lies on the line, and '0' indicates that the integer point does not lie on the line.

The horizontal row of '1's is the x-axis, and the vertical column of '1's is the y-axis.

The distances between adjacent rows and adjacent columns are always 1.

Output Format

Output one line: the equation of the line.

Constants should always be printed with 4 decimal places.

3
010
111
x1x

y=-1.0000

Hint

The testdata guarantees a unique solution.

Constraints: For 100% of the testdata, 3n163\le n\le16.

Translated by ChatGPT 5