Painter Problem

Please help me to find the mistake in my solution.
the code is link is:-

  1. to cover every point in the domain in binary search algorithm, the condition should be
    while(s<=e){
    }
  2. the data type of mid should be long long.

updated code: https://ide.codingblocks.com/s/215289
please rate and resolve if satisfied.
thansk

thank you so much for the help