| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 31 | 17 | 11 | 44.000% |
There is a trapezoid with vertices $(x_1, y_1),ドル $(x_1, y_2),ドル $(x_2, y_3),ドル $(x_2, y_4)$ in the Euclidean plane that is painted with a linear gradient (defined below).
Let a triple of real numbers $(r, g, b)$ represent a color of a point, and let us use this to define three colors:
The trapezoid is colored using a set of lines which collectively cover the entire area of the trapezoid and produce a color gradient. The set is defined as follows:
Calculate the total area of the red, blue, and green parts of the trapezoid.
The first line contains integers $x_1,ドル $y_1,ドル $y_2,ドル $r_{\ell},ドル $g_{\ell},ドル $b_{\ell}$.
The second line contains integers $x_2,ドル $y_3,ドル $y_4,ドル $r_r,ドル $g_r,ドル $b_r$.
Output three real numbers: the red area, the blue area, and the green area, respectively. The absolute or relative error should not exceed 10ドル^{-9}$.
0 0 50 255 0 0 100 0 100 0 255 0
1686.851211072 2724.913494800 0.000000000
Linear interpolation is a method of estimating values within an interval, based on known values at the endpoints. In the context of color interpolation, it means that the color components $(r, g, b)$ are calculated as a weighted average of the corresponding components of the left and right colors, with the weights determined by the relative distance of the point from the left endpoint and the right endpoint. This creates a smooth transition of colors along the line.