HDU 1087 Input contains multiple test cases. Each test case is described in a line as follow:N value_1 value_2 …value_N It is guarantied that N is not more than 1000 and all value_i are in the range of 32-int.A test case starting with 0 terminates th…