#define min(x, y) ((x)<(y)?(x):(y))