Template Function ADS::minValueExactWeight

Function Documentation

template<class T, class V>
std::optional<T> ADS::minValueExactWeight(const std::vector<V> &w, const std::vector<T> &v, V W)

the least value of coins of weights w and values v, in unlimited supply, weighing exactly W; nothing if there is none

Pre:

|w| = |v|, w positive, W >= 0