Mr Neo has fewer than 200 sweets. He wants to give his class an equal number of sweets. If he gives each pupil 3 sweets, he will have 70 left over. If he gives 5 sweets, he will need 10 more sweets.

How many pupils are there in the class?
How many sweets does Mr Neo have?

X = The total # of sweets.

Y = The total # of pupils.

Eq1: x - 3y = 70.
Eq2: x -5y = -10.

Subtract Eq1 from Eq2 and get:
2y = 80,
Y = 40 Pupils.

In Eq1, substitute 40 for Y:
x - 3*40 = 70,
x - 120 = 70,
X = 70 + 120 = 190 Sweets.