当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5048:Colorful Segment

Special Judge 特殊评判
题目描述

Additive color mixing: adding red to green yields yellow; adding red to blue yields magenta; adding green to blue yields cyan; adding all three primary colors together yields white.

In three dimensional space, there are N segments. Their initial color is black. In the red light, they will turn red. In the green light, they will turn green. In the blue light, they will turn blue. In the red and green light, they will turn yellow. In the red and blue light, they will turn magenta. In the green and blue light, they will turn cyan. In the red, green and blue light, they will turn white.

There are M light sources. They can transmit red, green or blue light. But the light they emitted only illuminate a small area. The ith( 1 ≤ i ≤ M ) light source is located at (xi, yi, zi) and it can illuminate an area of ellipsoidal with equation as follows.


Under irradiation of the M light sources, segments will show a different color. You should calculate the length of the segment in different colors.
输入解释
The first line of the input is T (1 ≤ T ≤ 100), which stands for the number of test cases you need to solve.

The first line of each case contains two integers N ,M (1 ≤ N, M ≤ 100), denoting the number of segments and light sources, respectively.

For the next N lines, eac line describes one segment with six integers x1, y1, z1, x2, y2, z2( -10000 ≤ x1, y1, z1, x2, y2, z2 ≤ 10000) which are coordinates of the segment’s ending.

Then follows M lines. Each line begins with six integers xi, yi, zi, ai, bi, ci as mentioned above (-10000 ≤ xi, yi, zi ≤ 10000, 1 ≤ ai, bi, ci ≤ 10000). At the end of the line is a character being ‘R’,‘G’ or ‘B’. ‘R’ means the light source emits red light. ‘G’ means the light source emits green light. ‘B’ means the light source emits blue light.
输出解释
For each test case, you should output 8 lines, output the length of segment with color black, red, green, blue, yellow, magenta, cyan, white in order. See detailed format from the sample output. Answer will be considered as correct if their absolute error is less than 10-5.
输入样例
2
1 2
-5 0 0 5 0 0
0 0 0 2 1 1 R
2 0 0 2 1 1 B
2 3
2 0 0 -2 0 0
0 -3 0 0 5 0
0 0 0 1 2 1 R
0 2 0 1 2 1 G
0 2 0 1 2 1 B
输出样例
4.00000
2.00000
0.00000
2.00000
0.00000
2.00000
0.00000
0.00000
4.00000
4.00000
0.00000
0.00000
0.00000
0.00000
2.00000
2.00000
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5048

最后修改于 2020-10-25T23:19:15+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)