Problem Link:https://codeforces.me/problemset/problem/442/B
I have been trying to solve it using DP, but there always seems to be precision issues even when using long double.
My submissions : https://codeforces.me/contest/442/submission/81584010
In my approach
dp[i].first = the max probabilty obtainable by choosing 1 or more friends from index i to n-1.
dp[i].second = the product of complements of probablity of all chosen friends.
dp[i].second is helping me do the transition.
Can anyone solve it using such DP without failing due to precision issues?