# How to get $\mid y\Big[\frac{x}{y}\Big]-a\mid <\mid x-a\mid + \mid y \mid \quad x,y\in R$?

The solution of a problem I had to work on states that :

$$\mid y\Big[\frac{x}{y}\Big]-a\mid <\mid x-a\mid + \mid y \mid \quad x,y\in R$$

Where $$[x]$$ is the integer part of $$x$$. I don't know to get this inequality... I only have : $$\mid y\Big[\frac{x}{y}\Big]-a\mid <\mid x + a\mid$$ Thanks for your help !

Write $$\left[\frac{x}{y}\right]= \frac{x}{y} - \left\{\frac{x}{y}\right\}$$, where $$\left\{\frac{x}{y}\right\} < 1$$ is the fractional part. Then apply the triangle inequality.