Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square?
Input
The first line of input contains N, the number of test cases. Each test case begins with an integer 4 #include using namespace std;int n, len[21];int used[21], tot;int can;bool cmp(int a,int b){ return a > b;}void dfs(int pos, int need, int done){ int i; if (done==0) {can = 1;return ; } if (need==tot) {for (i = 0; i < n; i++){ if (used[i... |