import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int n=Integer.parseInt(line); int[] w=new int[n]; int total=0; String[] values=br.readLine().split(" "); for(int i=0;i=w.length||sum<0){ return false; } return dfs(sum-w[now],now+1,w)?true:dfs(sum,now+1,w)?true:false; } }