compute c and d for median in C++
code zhang method for median