Title: http://www.lydsy.com:808/JudgeOnline/problem.php?id=1027
Analysis:
First of all because of an alloy and 1, so consider whether 2 material alloy can synthesize a demand alloy, as long as the first two values can be considered.
If we put these two values in a planar Cartesian coordinate system, set two material alloy coordinates (x, y) and (m,n), then the two material alloy can be synthesized by the demand alloy corresponding to the point at (x, y) (M,n) two points between the segment. (The nature of high school math vectors can be proven)
Then the problem is converted to: The plane has m material alloy point, N demand alloy point, requires the selection of the minimum material alloy point, so that these points can be all n demand alloy points all around.
The processing methods are:
Enumerate each of the two material alloy points p,q, judging whether all n demand alloy points are on the left side of the tangential segment PQ, if yes, then g[p][q]=1, otherwise g[p][q]=0. The advantage of this is that if there is a ring in Figure g, then the n points are in the ring, and the point on the ring (i.e. the material alloy point) is a combination of the alloy points of the material that satisfies. Since the material has the least alloy point, it is equivalent to finding the smallest ring in the G graph. Then the problem is solved.
[Bzoj 1027] [JSOI2007] Alloy (analytic geometry + minimum ring)