#include using namespace std; using Int = long long; //INSERT ABOVE HERE Int n,d,k; Int dp[101][1010][11]; Int dfs(Int x,Int y,Int z){ Int &res=dp[x][y][z]; if(~res) return res; if(x==n) return res=(y==d&&z==k); res=0; res|=dfs(x+1,y,z); if(y+(x+1)<=d&&z+1<=k) res|=dfs(x+1,y+(x+1),z+1); return res; } void dfs2(Int x,Int y,Int z){ if(x==n) return; if(y+(x+1)<=d&&z+1<=k&&dfs(x+1,y+(x+1),z+1)){ if(y) cout<<" "; cout<>n>>d>>k; memset(dp,-1,sizeof(dp)); if(!dfs(0,0,0)){ cout<<-1<