P10504 Guardian’s Challenge

Description

After opening the gate of the dark mage Vani, the team wandered through a maze-like path, searching aimlessly for the prison where applepi was held. Suddenly, a flash of light appeared before them. “I, Nizem, am the guardian of the Dark Magic Temple. If you can pass my challenge, you may take the map of the Dark Magic Temple...” In an instant, the team was teleported onto an arena. At the beginning, they had a backpack with capacity $K$. There are $N$ challenges in total, carried out in order. The $i$-th challenge has an attribute $a_i$: - If $a_i \geq 0$, then after succeeding in this challenge, they can obtain an additional backpack with capacity $a_i$. - If $a_i = -1$, then after succeeding in this challenge, they can obtain a map fragment of size $1$. All map fragments must be stored in backpacks to be taken out of the arena. The backpacks do not have to be completely filled, but the team must take away **all map fragments they have obtained** (fragments not obtained do not matter; it is only required that after completing all $N$ challenges, the total backpack capacity is enough to hold the map fragments). Only then can they assemble the complete map. Also, they must succeed in at least $L$ challenges to leave the arena. When the team was at a loss, the kind guardian Nizem estimated the success probability of each challenge. The success probability of the $i$-th challenge is $p_i\%$. Now, please help predict the probability that the team can leave the arena with the map fragments they obtained.

Input Format

The first line contains three integers $N, L, K$. The second line contains $N$ real numbers. The $i$-th real number $p_i$ indicates the success percentage of the $i$-th challenge. The third line contains $N$ integers. The $i$-th integer $a_i$ indicates the attribute value of the $i$-th challenge.

Output Format

Output one number, representing the required probability, rounded to $6$ decimal places.

Explanation/Hint

In the first sample, if the third challenge succeeds, then as long as one of the first two challenges is won, the team will have enough space to store the obtained map fragment. If the third challenge fails, then they did not obtain any map fragment at all, so there is no need to consider whether it can be stored. If the third challenge fails and one of the first two challenges is won, there will be no backpack to store the map fragment; if the first two challenges both fail, the requirement of succeeding at least once is not met. Therefore, the required probability is the probability that the third challenge is won. For $100\%$ of the testdata, it is guaranteed that $0 \leq K \leq 2000$, $0 \leq N \leq 200$, $-1 \leq a_i \leq 1000$, $0 \leq L \leq N$, and $0 \leq p_i \leq 100$. Translated by ChatGPT 5