#include <iostream>
int lesenki(int x, int size=1)
{
if (x < size) return 0;
if (x==size) return 1;
if (x<2) return x;
int result{1};
for (int i{size}; i <= x; i++)
result+=lesenki(x-i, i+1);
return result;
}
int main()
{
std::cout << lesenki(6);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IGxlc2Vua2koaW50IHgsIGludCBzaXplPTEpCnsKCWlmICh4IDwgc2l6ZSkgcmV0dXJuIDA7CglpZiAoeD09c2l6ZSkgcmV0dXJuIDE7CglpZiAoeDwyKSByZXR1cm4geDsKCglpbnQgcmVzdWx0ezF9OwoJCglmb3IgKGludCBpe3NpemV9OyBpIDw9IHg7IGkrKykKCQlyZXN1bHQrPWxlc2Vua2koeC1pLCBpKzEpOwoJCQoJcmV0dXJuIHJlc3VsdDsKfQoKaW50IG1haW4oKQp7CglzdGQ6OmNvdXQgPDwgbGVzZW5raSg2KTsKCQoJcmV0dXJuIDA7Cn0=