0 <= x <= n