当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
There is a structure consisting of K homogenous slices of equal thickness. The refraction index of the i-th slice is Ni. A ray of light travels in the first slice at the angle a to the normal. Write a program to compute the angle that the ray will have to the normal in the last slice.
It is known that the formula N1sinα=N2sinβ holds in a two-sliced structure with the refraction indices of the slices equal to N1 and N2, respectively, when a ray of light passes from the first slice to the second, traveling at the angle a to the normal in the first slice, and at the angle b to the normal in the second slice.
On the first line of the file is the number of slices K (1≤K≤100). Each of the following K lines contains the refraction index Ni of the corresponding slice. All the refraction indices are real numbers in the range from 0.000001 to 2000. The last line of the file contains the angle α between the ray and the normal in the first slice. The angle is a real number in the range from 0 to π/2 and is given in radians.
The first and only line of the file must contain the angle β between the ray and the normal in the last slice. The answer must be given with the precision of 0.001. If the ray does not reach the last slice, the output must be the word ‘NO’.
2 1 2 0.02
0.01
时间上限 | 内存上限 |
1000 | 65536 |