Following are my two C++ submissions for today`s contest AIM Tech Round 5 problem C,
Both are exactly same except an extra semicolon.
The solution is of O(NlogN) time complexity. Although my submissions were after the contest, but its highly likely that some users may have faced the similar issue during the contest, which is unfortunate.