#include<iostream>
#include<algorithm>
#include<fstream>
#include<ctime>
using namespace std;
//#define DEBUG
/* 240K 297MS */
#define MAX 64
static int len[MAX];
static int used[MAX];
static int ok;
static int sum;
static int n;
static int side;
void search_dfs(int start, int curlen, int count)/* 共有4个返回点 */
{
if (count >= 3)
ok = 1;
if (ok == 1)
return ; /* 剪枝,已经找到了*/
for (int i = start; i < n; i++)
{
if (used[i]) continue;
int tmplen = curlen + len[i];
if (tmplen == side) /* 已经找到一条边 */
{
used[i] = 1;
search_dfs(0, 0, count + 1);
used[i] = 0;/* 上面的搜索没有成功时,很重要*/
}
else if (tmplen < side) /* 不足一条边 */
{
used[i] = 1;
search_dfs(i + 1, tmplen, count);
used[i] = 0;
}
else /* 超过一条边