According to me, the 1st example in this question is wrong , and 9(3+5+1) will exist between 2 and 10 and will satisfy all the given conditions.
Someone , kindly get the error corrected.
Or if maybe , I am thinking wrong , guide me(Obviously , after the contest , because that would be cheating).
Here is the link to that question : CodeChef: Practical coding for everyone