0-1 knapsack without repetition
Here is how you encode the input:


Weight and value of item 1.
Weight and value of item 2.
...
Weight and value of item $n$.
$W$.


Suppose that the weight and value are integers, are at most $M$, and both are encoded in binary, as is $W$. Then the length of the encoding is
$$
\Omega(n + \log W), O(n\log M + \log W).
$$
Hopefully this clarifies the difference between $n$ and $W$.