1 6
11
#include <stdio.h> int n, len, temp, sum, pre = 10; void DFS(int k){ if(k > len){ if(temp == n) ++sum; return; } int t = pre; for(int i = n; i > 0; --i){ if(i <= pre && i + temp <= n){ temp += i; pre = i; DFS(k + 1); temp -= i; pre = t; } } } int main(){ int t; scanf("%d", &t); while(t--){ scanf("%d", &n); sum = 0; temp = 0; for(len = 1; len <= n; ++len) DFS(1); printf("%d\n", sum); } return 0; }