static bool inRange(int x, int n) { ret x >= 0 && x < n; }