(Canada, 1996). Let $r_{1}, \ldots, r_{m}$ be positive rationals such that $r_{1}+\cdots+r_{m}=1$. We define $f(n)=n-\sum\left\lfloor r_{i} n\right\rfloor$. What are the minimal and maximal values taken by $f(n)$?
. Since $\left\lfloor r_{i} n\right\rfloor > r_{i} n - 1$, we have $0 \leqslant f(n) < m$. If N is a multiple of all the denominators of the $r_{i}$, the $r_{i} N$ are integers, so $f(N)=0$. Then we have $r_{i}(N-1)-\left\lfloor r_{i}(N-1)\right\rfloor = r_{i}(N-1) - \left(r_{i} N - 1\right)$, and by summing, $f(N-1)=m-1$.