//
// main.cpp
// OPTIMAL-BST
//
// Created by Spike_Bebop on 16/1/3.
// Copyright © 2016年 Spike_Bebop. All rights reserved.
//
#include <iostream>
#define MAX 1000010;
#define NUM 5;
using namespace std;
const int n=NUM;
double e[n+2][n+2],w[n+2][n+2],root[n+1][n+1];
double p[n+1]={-1,0.15,0.1,0.05,0.1,0.2},q[n+1]={ 0.05,0.1,0.05,0.05,0.05,0.1};
void PrintRoot()