<prompt> Una baadhi ya sarafu. Sarafu i-th ina uwezekano probi wa vichwa vinavyotazamana wakati vikirushwa.Rejesha uwezekano kwamba idadi ya sarafu zinazoelekea kwenye vichwa ni sawa na lengo ikiwa utatupa kila sarafu mara moja.Mfano wa 1:Ingizo: prob 0.4, lengo 1Pato: 0.40000Mfano wa 2:Ingizo: prob 0.5,0.5,0.5,0.5,0.5, lengo 0Pato: 0.03125Vikwazo: 1 prob.length 1000 0 probi 1 0 lengo prob.length Majibu yatakubaliwa kuwa sahihi ikiwa yako ndani ya 10-5 ya jibu sahihi.  <response>: def max_valuearr1, arr2: n lenzi arr1 max1 max2 max3 max4 kuelea-inf min1 min2 min3 min4 kueleainf kwa mimi katika safun: max1 maxmax1, arr1i - arr2i i max2 maxmax2, arr1i arr2i i max3 maxmax3, -arr1i arr2i i max4 maxmax4, -arr1i - arr2i i min1 minmin1, arr1i - arr2i i min2 minmin2, arr1i arr2i i min3 minmin3, -arr1i arr2i i min4 minmin4, -arr1i - arr2i i max1 - min1, max2 - min2, max3 - min3, max4 - min4 