Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
Language:
Ray
Time Limit: 1000MSMemory Limit: 65536K
Total Submissions: 2063Accepted: 435Special Judge

Description

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.

Input

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.

Output

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’.

Sample Input

2
1
2
0.02

Sample Output

0.01

Source

Northeastern Europe 2002, Western Subregion

[Submit]   [Go Back]   [Status]   [Discuss]

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator