{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cdiv style\u003d\"clear:both\"\u003e\r\n\t\u0026nbsp;\u003c/div\u003e\r\n\u003cp\u003e\r\n\t\u003cimg align\u003d\"right\" src\u003d\"http://uva.onlinejudge.org/external/101/p10125.gif\" /\u003e\u003c/p\u003e\r\n\u003ch2\u003e\r\n\tProblem D - Find D\u003c/h2\u003e\r\n\u003cp\u003e\r\n\t\u003cspan style\u003d\"font-size:16px;\"\u003eUsers are ranked according to the most problems solved. Ties will be broken by the total time for each user in ascending order of time. So solve the following problem quickly and without any penalty ;)\u003c/span\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003e\r\n\tGiven S, a set of integers, find the largest d such that a + b + c \u003d d where a, b, c, and d are distinct elements of S.\u003c/p\u003e\r\n\u003ch3\u003e\r\n\tInput\u003c/h3\u003e\r\n\u003cp\u003e\r\n\tSeveral S, each consisting of a line containing an integer 1 \u0026lt;\u003d n \u0026lt;\u003d 1000 indicating the number of elements in S, followed by the elements of S, one per line. Each element of S is a distinct integer between -536870912 and +536870911 inclusive. The last line of input contains 0.\u003c/p\u003e\r\n\u003ch3\u003e\r\n\tOutput\u003c/h3\u003e\r\n\u003cp\u003e\r\n\tFor each S, a single line containing d, or a single line containing \u0026quot;no solution\u0026quot;.\u003c/p\u003e\r\n\u003ch3\u003e\r\n\tSample Input\u003c/h3\u003e\r\n\u003cpre\u003e\r\n5\r\n2 \r\n3 \r\n5 \r\n7 \r\n12\r\n5\r\n2 \r\n16 \r\n64 \r\n256 \r\n1024\r\n0\r\n\u003c/pre\u003e\r\n\u003ch3\u003e\r\n\tOutput for Sample Input\u003c/h3\u003e\r\n\u003cpre\u003e\r\n12\r\nno solution\r\n\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThink about a + b + c \u003d d , so (a + b \u003d d - c) , so a\u0026lt;b\u0026lt;c\u0026lt;d , find\u0026nbsp; a + b for a fixed d-c\u003c/p\u003e"}}]}