The profit is divided in the ratio 2:1, so the ratio of their investments is:
\[ \frac{95,000 \times 12}{57,000 \times (12 - x)} = 2 \]
\[ \frac{12}{12 - x} = \frac{2 \times 57,000}{95,000} \]
\[ \frac{12}{12 - x} = \frac{114,000}{95,000} \]
\[ \frac{12}{12 - x} = 1.2 \]
\[ 12 = 1.2 \times (12 - x) \]
\[ 12 = 14.4 - 1.2x \]
\[ 1.2x = 2.4 \]
\[ x = 2 \]
Thus, Viju joined after 2 months.