// requires valid arguments
  static int KL(long WS, int T, int Al, int n) {

    // must cast to int after getting the minimum to avoid integer overflow
    final int K_upper_bound = (int) Math.min(K_max, WS / subSymbolSize(T, Al, n));
    return SystematicIndices.floor(K_upper_bound);
  }