#pragma once template inline T clamp(T v, T a, T b) { return min(max(v, a), b); } #define size(V) (sizeof(V) / sizeof(V[0]))