Motu Patlu and Akku

0

0 votes
Easy
Problem

Motu, Patlu and Akku go out for a midnight walk. All three of them have a week eye vision. So while walking, they try to test their vision without glasses. They try to see and recognize a number plate. Now each of the three can guess the characters correctly with different probability ranging from 0 to 1, where 0 means they will get it wrong everytime and 1 means they get it correct everytime.

They make a combined effort in guessing the whole string and are curious to know what is the probability that they got it correct. Can you help them?

INPUT:

First line contains number N denoting the length of the string and the string consisting of alphanumerics. Next three lines contains N numbers each describing the probability of guessing the corresponding character of the string correctly by the Motu, Patlu and Akku.

OUTPUT:

In a single line ouput the probability that they guessed the entire string correctly upto 6 decimal points.

CONSTRAINTS:

1<=N<=10

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?