Description
Your rich uncle died recently, and the heritage needs to be divided among your relatives and the church (your uncle insisted in his will that the church must get something). There are N relatives (N <= 18) that were mentioned in the will. They are sorted in descending order according to their importance (the first one is the most important). Since you are the computer scientist in the family, your relatives asked you to help them. They need help, because there are some blanks in the will left to be filled. Here is how the will looks:
#include
struct node
{
char *p;
int flag;
} list[] = {
{""
,50},
{""
,51},
{""
,55},
{"K"
,34},
{"2';"
,34},
{"@_L"
,51},
{"*a X(';"
,34},
{"+B7g>WJ2LD* L"
,51},
{",vQFd@nc1HUgM\203s\\\200/Na@[PSp"
,55},
{"0W&`i8S\203`3td3VLK{p!k-/;&Ej\201t2SFwbUZd_hHd({3x-1E`SuL"
,51},
{";G8R>v##.7I\"B=0jd^q3K`Dkp{N;~ic~0(e4:6e}_K@+t$Z8F_Q=VwE_1i%pkFsJ~\\BQXI m#O]A$l!cGMNQrsuV/ 5G4p"
,55},
{"k#NAG)<_+NJ2Bs`=>1FO8. ii7_1btG1dEJF7h 7@#hJjs\2023i^;Q>\\*iv~4eT2kz6Z<-S;]GB\\h\\;mKwex\200(\\>Pbwo^kb3R3\202CPL2FI#)d\203Q8b\\';';@\202onT}5;we7\202AHQjP73\\$xA)IJT?t`nnRC\\7G:+QC`h}gAo1mAvc!AICqUjznp47,a)@*?\"8Gf`Kg.x}:,t40+MD*L"
,51},
{"X>3^(+*]xiUMo>=-+;`S:M^!Rs@o1h.3bcS[/[xBWrp;`A=j)>@%P(\202DYSXZ*fx bth~h7U9S3`sI;.\"h?c4d0W4b!%|-O9,Klq(j/||+r8;LHzn^\203_L&i9\"SSk/&`iGdQ[O~FCI|\202~fO$x^+hj[p(`Cp/3YWqbHFfDIp3jMAVvJF,?Pcs,\203F<@qZ:,EIPvM.5WbO&\\ 3@\202)2]5\202s6NJ';H\201QM(+_v=/~|*e#uCA84(hAw+s\201oQpYZnCgX_';jDYtlaucs~\"!R>kKLyzdc0^\201Cr*-teQT\"2](s\200!~9q6>xny)d+Bb{>U/psh>fSX\"m_8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ms';3?/q5r1IJPpFB2uTR+O6BS.\203:&Ca}kU\201X_9\203)%M/(F)y|[x.M\2038\202-!![#6EQ\200!=,p"
,55},
{"*G@w{zw3qHEO,H`)/bZDc\"irSxXc9f\201/U&L7\202(@I>)\200GyH ^G-[*FTVYOoiYb9K+vYfpT1PF3K\203]u)J%SdZFB+mNTK!V/3CcbG\203{yGqK8u.GR1Y4}';G\203tl}+g~j\"PTs\202w2]=q`O\203q:0Y+Ej6QG.HG}VN V$F`9;L+)*Xv4?{Nn \201GnXc.XN^(|FfCfll{R[U}@%<*\200Eby\200>wAx$^YfKKK>u/UF$ZhuY*,:';;ab8T9mXEO_pO[d^^\201Q\200\\,C6M:1@~J\"iKb}++/6wxu+|V\203fT?A\202!&f/T^zub W@{0N"
"3,7x5({$r-,\200W]mKo-i\200\203>_IN=7CD+:]7v~:\203v4e\\V\201\203(bpO\203\"_q|4im.&\201[S}\201P';U?ScQB*GNcnTt|a@OW1#`Aszt\\Pdx?$:%LE^V#(\2017^{TUduEJv$N\"^=[z\20067KL}aIXspUr#U?-&,yR}]rW y\201o$m1&1M |