Ratio: add missing #include <algorithm>