You could create a class containing two elements;
int less, int more.
in the set method, you check if the value follows the rules, if it does, set. If the input does not follow the rules: Don't set, or set to the edge (make less = more - 1, for example)
1 2 3 4 5 6 7 8 9
class smth
{
public:
smth() : less(0), more(1) {}
void setMore(int a){if (a > less) more = a; else more = less + 1;}
void setLess(int a){if (a < more) less = a; else less = more - 1;}
private:
int less, more;
};