/* v[] //表示150内的素数 */ #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int c1[150], c2[150]; int v[40] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 1555}; void init() { memset(c1, 0, sizeof(c1)); memset(c2, 0, sizeof(c2)); for (int i = 0; i <= 150; i+=2) //+=2 因为2为第一个素数 为 第一个小组 c1[i] = 1; for (int i = 2; i <= 35; i++) { for (int j = 0; j<= 150; j++) { for (int k = 0; j+k <= 150; k += v[i]) {//几个v[i]小组 c2[j+k] += c1[j]; } } for (int j = 0; j <= 150; j++) { c1[j] = c2[j]; c2[j] = 0; } } } int main() { int t; init(); scanf("%d", &t); while (t--) { int n; scanf("%d", &n); printf("%d ", c1[n]); } }