public static Set cal(int n , int m){
        Set[][] a = new HashSet[n+1][m+1];
        for(int i= 0; i<=n;i++)
            for(int j = 0; j<=m;j++){
                a[i][j] = new HashSet();
                if(j==i && i >= 1) {
                    List l = new ArrayList();
                    l.add(j);
                    a[i][j].add(l);
                }
            }

        for(int i = 1; i <= n ; i++){    //2

             for(int j = m ; j >=0; j--){   //3
                 if(a[i-1][j].size() >0)
                 addAll( a[i][j],a[i-1][j]);
                 if(j-i < 0) continue;
                 //i 放
                 Set tmpM_i = new HashSet();
                 addAll(tmpM_i,a[i-1][j-i]);
                     for(Iterator it = tmpM_i.iterator();it.hasNext();){
                         List l = (List) it.next();
                         l.add(i);
                     }
                 addAll(a[i][j],tmpM_i);
             }
        }

       return a[n][m];
    }