What should be the approach for this problem? I have seen other coders’ solution, but I am not able to understand.How binary search can be applied? Please help me.
Problem link: https://www.codechef.com/TJCN2019/problems/TSECJC04
I am really thankful to you.
Editorials for all contest problems were posted yesterday, but not linked to contest problems
You can find them all here : https://discuss.codechef.com/tags/tjcn2019/
@amish19 i don’t know is there any mathematical soln is present or not,but the best way you can use is binary search,let assume that 1st container will have water level at 1 as we have to maximize K so now we will binary search over answer to find the maximum value of K,Now when we get it now again we will use binary search to maximize the initial water level of container 1 because we assume that first container has water level 1 but it might be possible that even the water level is >1 then also it will be possible :-).