UVA 10688 - The Poor Giant

The full problem description can be found here.
Note!!!

There is an error in the question. Right above where the input is given, it says:

"... he eats total weight of 1, 3, 3, 3 ... This yields a solution of 1 + 3 + 3 + 3 = 13".

This is a mistake. It should say:

"... he eats total weight of 1, 4, 4, 4 ... This yields a solution of 1 + 4 + 4 + 4 = 13".

Java Code