olya want buy custom wardrobe it n box height a1a2an stack order in word represent box vertical segment length ai segment form single segment 0 overlapssome box important case bi1 bi0 Olya define convenience wardrobe number important box edge locate height l r inclusiveyou give information height box importance Compute maximum possible convenience wardrobe reorder box arbitrarily