the algorithm implementation of cpp version in "Algorithms and Hardness for Scaffold Filling to Maximize Increased Duo-preservations"