#include using namespace std; const int SIZE = 10; const int MAXNUM = 6; bool bestStrat[SIZE]; int bestStratSize = 0; double calcProb(int n, bool correct[], bool strategy[], int num[], int likely[], double prob[]) { double ans = 1.0, p; for(int i=0; i0; count--) { int i=0; while (!correct[i]) { correct[i] = true; i++; } correct[i] = false; double thisProb = calcProb(n, correct, strategy, num, likely, prob); if (thisProb != 0) { int j=0; for(int k=0; k= best) { best = curr; if (level==0) { bestStratSize = n; for(int i=0;i> n; while (n != 0) { for(int i=0; i> num[i] >> likely[i] >> prob[i]; } double ans = bestStrategy(n, num, likely, prob, 0); ans = ((int)(1000*ans+0.5))/1000.0; cout << ans << endl;; cin >> n; } }