1 2 3 4 5
#pragma once #include <algorithm> template <typename T> void update_min(T &x, T a) { x = std::min(x, a); }