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 i
th( 1 ≤ i ≤ M ) light source is located at (x
i, y
i, z
i) 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.