Problems with tag O(nlogx)