#include #include #include using namespace std; int main(int argv, char** argc) { const int n = 101; // number of terms vector> a_ns = vector>(); vector> b_ns = vector>(); for (int i = 1; i <= n; i++) { a_ns.push_back(unordered_set()); a_ns[i - 1].insert(0); b_ns.push_back(unordered_set()); b_ns[i - 1].insert(i * i); } b_ns[0].insert(1); for (int i = 1; i <= n; i++) { for (int j = 1; j <= i / 2; j++) { unordered_set as = b_ns[j - 1]; unordered_set bs = b_ns[i - j - 1]; for (auto a = as.begin(); a != as.end(); ++a) { for (auto b = bs.begin(); b != bs.end(); ++b) { b_ns[i - 1].insert((*a) + (*b)); } } } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; ++j) { a_ns[i - 1].insert(b_ns[j - 1].begin(), b_ns[j - 1].end()); } cout << a_ns[i - 1].size() << "\n"; } return 0; }