A Polynomial Time Algorithm for a Class of Contig-Based Two-Sided Scaffold Filling