# Solving an inequality involving sum of floors

Suppose I want to find $t_{critical}(u)$, the least $t\in\mathbb{R}^+$ for a given $u\in\left(0\ldots\dfrac{1}{s}\right]$ satisfying $$f(t)=\lfloor rt\rfloor x+\lfloor s (t-u)\rfloor y + y > h$$ for constant $h, r, s, x, y \in \mathbb{R}^+$.

It's plain to see that $f(0)=0$ and $f$ is a monotonically increasing step function.

I was able to determine that $t_{critical}(u)$ must be of the form $$\frac{j}{r}, j \in \mathbb{Z}^+$$ or $$\frac{k+u}{s}, k \in \mathbb{Z}^+$$ I suspect the formulas for $j$ and $k$ will involve ceiling or floor functions in order to end up as integers.

Is there a way to come up with a general piecewise expression for $t_{critical}(u)$?

-
FYI - not a homework question; it is about optimizing damage-per-second in an online game. – Snowbody Mar 31 '14 at 21:01