#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 and are constants):
Input Format
The first line contains a positive integer , indicating the size of the figure is .
The next lines each contain 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, .
Translated by ChatGPT 5
京公网安备 11011102002149号