hi, it is c++ algorithm , please dont bid unless you sure 100% can do it on time.
note: i attached about 40% of the work so first you need to modify the hard constraint i attached so that the subset will work.
then you still to do soft constraint