2515. Do It

单点时限: 10.0 sec

内存限制: 256 MB

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, Ai, ωi, and φi are all given:

输入格式

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

N R

A1 ω1 φ1

A2 ω2 φ2

AN ωN φN

The numbers in the input are all integers and satisfy the following conditions: 1 ≤ N ≤ 16, 1 ≤ R ≤ 104, 1 ≤ Ai ≤ 10, 0 ≤ ωi ≤ 100 and 0 ≤ φi ≤ 360.

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.

样例

Input
1 1
1 1 0
0 0
Output
0.45969769413186

1 人解决,4 人已尝试。

1 份提交通过,共有 13 份提交。

9.9 EMB 奖励。

创建: 15 年,8 月前.

修改: 6 年,10 月前.

最后提交: 3 年,12 月前.

来源: N/A

题目标签