#Lutece1142. Meet-in-the-middle
Meet-in-the-middle
Migrated from Lutece 1142 Meet-in-the-middle
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Given S, a set of integers, find the largest such that where and are distinct
elements of S.
Input
Several S, each consisting of a line containing an integer indicating the number of elements in S, followed by the elements of S, in a line. Each element of S is a distinct
integer between and inclusive. The last line of input contains .
Output
For each S, a single line containing , or a single line containing no solution
.
Samples
5
2 3 5 7 12
5
2 16 64 256 1024
0
12
no solution
Resources
peterpan