ksum problem: naive and meet-in-the-middle paradigm