Let \(n\) and \(r\) be two given positive integers. We wish to construct \(r\) subsets \(A_1, A_2, \ldots, A_r\) of \(\{0,1, \ldots, n-1\}\), each of cardinality \(k\), such that for each integer \(x\) with \(0 \leq x \leq n-1\) there exist elements \(x_i \in A_i(i=1, \ldots, n)\) with \(x=x_1+x_2+\cdots+x_r\). Find the minimum value of \(k\).