Alex, Bernard and Cindy had a total of 840 sweets. The ratio of the number of sweets Bernard had to the number of sweets Cindy had was 1:4. After Alex and Bernard each gave away 1/2 of their sweets, the 3 children had 620 sweets left. How many sweets did Bernard have at first?

Let "x" be the number of sweets Bernard had at first.

Then the number of sweets Cindy had initially was 4x;

and the number of sweets Alex had initially was the rest, (840-x-4x) = 840-5x.

After Alex and Bernard each gave away 1/2 of their sweets, the 3 children had 620 sweets left.

Mathematical translation is THIS equation

0.5 * ((840-5x) + x) + 4x = 620 for the remaining sweets.

Simplify

0.5*(840-4x) + 4x = 620

420 - 2x + 4x = 620

420 + 2x = 620

2x = 620 - 420 = 200

x = 200/2 = 100.

Bernard had 100 sweets at first.