Independent Events
시간 제한2초메모리 제한512 MB
확률 배열에서 구간 곱셈 갱신을 처리하며, 구간 질의마다 log(1 - p_i)의 합을 구해 출력한다.
문제
Yuuka is interested in independent events. The probability that the -th event occurs is . Yuuka is going to perform operations, each being one of the following:
- "0 ": considering only the events from to (both inclusive), find the probability that none of these events occur. As the value may be too small, you need to print the natural logarithm of the probability: if the probability is , print .
- "1 ": for all , multiply by . All events remain independent.
입력
The input contains zero or more test cases, and is terminated by end-of-file. For each test case:
The first line contains two integers and : the number of events and the number of operations ().
The second line contains real numbers where is the probability that the -th event occurs ().
The following lines provide the descriptions of the operations. The -th line starts with an integer : the type of the corresponding operation. If is "0", it is followed by two integers and . If is "1", it is followed by two integers and , and a real number (, ).
Each real number in the input has exactly five digits after the decimal point. Additionally, it is guaranteed that, at every moment, every lies in the interval .
It is guaranteed that neither the sum of all nor the sum of all will exceed .
출력
For each operation of type "0", output a real number denoting the answer. Your answer will be considered correct if its relative error doesn't exceed .