i am not being able to find a working solution. is this problem right?

one more thing is that: if the sum has to be equal to 2014, the answer comes to 53

or if the number has to be maximum and less than 2014, the answer becomes 63. and according to judge both are wrong.

what am i missing?

Who told you to think for only positive numbers??