#K59172. Optimal Triangle for Maximizing Harvester Coverage

    ID: 30806 Type: Default 1000ms 256MiB

Optimal Triangle for Maximizing Harvester Coverage

Optimal Triangle for Maximizing Harvester Coverage

You are given a rectangular field with length \(L\) and width \(W\). In the field, there are several harvesters. Each harvester is initially located at \((x_i, y_i)\) and has a speed \(v_i\). In one second, a harvester can move to any point within a Manhattan distance of \(v_i\) from its original position (i.e. any \((x,y)\) such that \(|x-x_i|+|y-y_i| \le v_i\)), provided the new location stays within the field boundaries (i.e. \(0 \le x \le L\) and \(0 \le y \le W\)).

Your task is to select three distinct points from the union of all possible positions reachable by any harvester after one second, such that these three points are not collinear (i.e. they form a valid triangle). The intention is that these three points will define a circle (the circumscribed circle of the triangle) whose area is as large as possible in expectation of capturing the maximum number of harvesters in a photo. (Note: For the purposes of this problem, you just need to output any valid non‐collinear triple.)

Note: The input will be given from standard input and the output must be written to standard output.

inputFormat

The first line contains two integers \(L\) and \(W\), representing the length and width of the field.

The second line contains a single integer \(n\), the number of harvesters.

Each of the following \(n\) lines contains three integers \(x_i\), \(y_i\) and \(v_i\), representing the initial coordinates and the speed of the \(i\)-th harvester.

outputFormat

Print three lines. Each line should contain two integers separated by a space, representing the \(x\) and \(y\) coordinates of one of the chosen points. The three points must be non-collinear.

## sample
10 10
3
2 2 1
8 8 2
5 5 1
1 1

1 2 2 1

</p>