Now judge is temporally not available for this problem. We are earnestly making necessary data. Sorry for the inconvenience.

There is sometimes difficulty giving nice backgrounds to contest problems. So let this problem kept this
simple - write a program that calculates the value of the following formula where the parameters *N*, *R*,
*A _{i}*,

The input consists of a series of datasets each of which has the following format:

N RA_{1}ω_{1}φ_{1}A_{2}ω_{2}φ_{2}...A_{N}ω_{N}φ_{N}

The numbers in the input are all integers and satisfy the following conditions: 1 ≤ *N* ≤ 16, 1 ≤ *R* ≤ 10^{4},
1 ≤ *A _{i}* ≤ 10, 0 ≤

The end of input is indicated by *N* = *R* = 0. This is not part of any dataset and hence should not be
processed.

For each dataset, print the result of the integration in a line. The result may be printed with an arbitrary
number of fractional digits, but should have a relative or absolute error not greater than 10^{-8}.

1 1 1 1 0 0 0

0.45969769413186

Source: ACM-ICPC Japan Alumni Group Summer Camp 2008
, Day 4, Tokyo, Japan, 2008-09-15

http://acm-icpc.aitea.net/

http://acm-icpc.aitea.net/