Define $[a]$ as the largest integer not greater than $a$. For example, $\left[\frac{11}3\right]=3$. Given the function $$f(x)=\left[\frac x7\right]\left[\frac{37}x\right],$$ where $x$ is an integer such that $1\le x\le45$, how many values can $f(x)$ assume?
A. $1$ B. $3$ C. $4$ D. $5$ E. $6$
I have attempted this question by brute force however I am looking for a cleaner, more systematic approach.
First, $f(x) \le \left[\frac{x}{7}\cdot\frac{37}{x}\right] = 5$, and $f(x) \ge 0$. Therefore, $f(x)$ can assume a maximum of $6$ values: $0,1,2,3,4,5$.
Second, $f(x)=1$ implies $\left[\frac{x}{7}\right]=1$ and $\left[\frac{37}{x}\right]=1$. The first condition implies $7 \le x \le 13$, while the latter requires $19 \le x \le 37$, which is impossible. So $f(x) \neq 1$.
Checking first few values of $x$ reveals that $f(x)$ can assume the values $2,3,4,5$. Specifically, for $1 \le x \le 6$, we have $f(x)=0$ as $[x/7]=0$. For $x=7$, $f(x) = 5$; for $x=8,9$, $f(x)=4$; for $x=10, 11, 12$, $f(x)=3$, and for $x=13$, $f(x)=2$.
Consequently, the number of values $f(x)$ can assume is $5$.