# FB HackerCup 2015 R1 40:CorporateGifting

Problem definition can be found here.
Need some tricks on recursion.
And if keep dp size for about $\sqrt{N}$ will cause the program run too LONG!