Update DynamicPath.cpp

min and max should be inclusive