$20\{x\} = x + [x] + [x + 0.5]$ 
Let $A = \{x \, | \; 20\{x\} = x + [x] + [x + 0.5] \, \}$, if S = sum of elements of $A$, find $[S]$ where $[x]$ integer part of $x$ and $\{x\} = x - [x]$.

Source: Stage 1 of India MO
I was actually trying to get better at solving these types of questions involving [.] and {x} so i found it confusing.
My attempt:
I took two cases, one for $\{x\}<0.5$ and another for $\{x\}>0.5$ and on writing $[x]$ as $x-\{x\}$, I came up with $19x = 22[x]$ for one of the cases but I am not sure what to do next.
If you could also tell me general methods to tackle such problems, I would be thankful. Thank you!
 A: Rewriting the constraint
$$19 \{x\} = [x] + [x] + [x + 0.5]$$
we see, that left part is in range $[0; 19]$, and right part is integer. Let that integer be $k$.
Now we can through all $k=0, 1, ..., 19$, and find $x$ for each of them (of course, not for all $k$ such $x$ exists). It's straightforward to express $\{x\}$ and $[x]$ in terms of $k$:
$$
\{x\} = \frac{k}{19} \\
k = [x] + [x] + [x + 0.5] = 2 [x] + [ [x] + \{x\} + 0.5] = \\
= 3 [x] + [\{x\} + 0.5] = 3 [x] + \left[ \frac{k}{19} + \frac12 \right] \\
[x] = \frac13 \left( k - \left[ \frac{k}{19} + \frac12 \right]\right)
$$
Now with some diligence (which I lack) we can find all $x$ in $A$ and get the answer.
A: Let $x=n+\dfrac m{20}$, with $n$ integer and $0\le m<20$.
The equation reads
$$m = n+\frac m{20} + n + n$$ ($m<10$) or $$m = n+\frac m{20} + n + n+1$$ otherwise.
So
$$0\le\frac{19}{60}m=n<\frac{19}3$$ or
$$\frac{17}6\le \frac{19m-20}{60}=n<6.$$
From the possible values of $n$, you draw $m$ and $x$.
A: Let call $n=\lfloor x\rfloor\in\mathbb Z$ and $r=\{x\}\in[0,1)$ to avoid writing all these brackets.
$x\in A\iff 20r=n+r+n+\lfloor n+r+0.5\rfloor=3n+r+\lfloor r+0.5\rfloor$

*

*for $r<0.5$ we have $19r=3n\implies n=\frac {19r}3<\frac{19}6\implies n\le 3$

*for $r\ge0.5$ we have $19r=3n+1\implies \frac{19-2}6\le n=\frac{19r-1}3<\frac{19-1}3\implies 3\le n\le 5$

Since there are so few $n$ possible, let calculate the corresponding $x$:

*

*For small $r$ first $n=0,1,2,3$ then $r=0,\frac 3{19},\frac 6{19},\frac 9{19}$

*For big $r$ now $n=3,4,5$ then $r=\frac {10}{19},\frac {13}{19},\frac {16}{19}$
$S=(0+1+2+3+3+4+5)+\dfrac 1{19}(0+3+6+9+10+13+16)=18+\dfrac{57}{19}=21$
I let you find $[S]$.
A: You already doing good,
I'll just continue that...
$\mathrm{20}\left\{{x}\right\}={x}+\left[{x}\right]+\left[{x}+\frac{\mathrm{1}}{\mathrm{2}}\right] \\ $
${let}:\left\{{x}\right\}\in\left[\mathrm{0},\frac{\mathrm{1}}{\mathrm{2}}\right)\Rightarrow\mathrm{3}\left[{x}\right]=\mathrm{19}\left\{{x}\right\} \\ $
$\left[{x}\right]\in\left[\mathrm{0},\frac{\mathrm{19}}{\mathrm{6}}\right)\Rightarrow\left[{x}\right]\in\left\{\mathrm{0},\mathrm{1},\mathrm{2},\mathrm{3}\right\} \\ $
$\mathrm{3}\left[{x}\right]=\mathrm{19}\left\{{x}\right\}\Rightarrow\mathrm{22}\left[{x}\right]=\mathrm{19}{x} \\ $
${x}=\frac{\mathrm{22}}{\mathrm{19}}\left[{x}\right]\Rightarrow{S}_{\mathrm{1}} =\frac{\mathrm{22}}{\mathrm{19}}\left(\mathrm{0}+\mathrm{1}+\mathrm{2}+\mathrm{3}\right)=\frac{\mathrm{132}}{\mathrm{19}} \\ $
${let}:\left\{{x}\right\}\in\left[\frac{\mathrm{1}}{\mathrm{2}},\mathrm{1}\right)\Rightarrow\mathrm{3}\left[{x}\right]=\mathrm{19}\left\{{x}\right\}−\mathrm{1} \\ $
$\left[{x}\right]\in\left[\frac{\mathrm{17}}{\mathrm{6}},\mathrm{6}\right)\Rightarrow\left[{x}\right]\in\left\{\mathrm{3},\mathrm{4},\mathrm{5}\right\} \\ $
$\mathrm{3}\left[{x}\right]=\mathrm{19}\left\{{x}\right\}−\mathrm{1}\Rightarrow\mathrm{22}\left[{x}\right]+\mathrm{1}=\mathrm{19}{x} \\ $
${x}=\frac{\mathrm{22}\left[{x}\right]+\mathrm{1}}{\mathrm{19}}\Rightarrow{S}_{\mathrm{2}} =\frac{\mathrm{263}}{\mathrm{19}} \\ $
${S}_{\mathrm{1}} +{S}_{\mathrm{2}} =\frac{\mathrm{132}}{\mathrm{19}}+\frac{\mathrm{263}}{\mathrm{19}}=\frac{\mathrm{395}}{\mathrm{19}} \\ $
$ \\ $
