As I was creating a function for printing monospaced text to a limited-length console with a certain level of indentation, I found a difficult equation to solve without programming around it: $r=\operatorname{ceil}\left(\frac{l+r\cdot t}{c}\right)$. This function represents the amount of rows $r$ in a console a string of text with length $l$ takes up if each line of text is prefixed by $t$ spaces and the maximum length of the console is $c$. For example, this text:
oooooooooooooo
oooooooooooooo
ooooo
satisfies the equation: $r=\operatorname{ceil}\left(\frac{34+r\cdot4}{19}\right)$ for $r=3$.
My question is simple; how do you solve this equation for $r$?