these are proportions and can be solved by cross multiplying and solving for the variable.
8/a = 21/42
cross multiply
(21)(a) = (8)(42)
21a = 336...divide both sides by 21
a = 336/21
a = 16
also, u will notice that : 8/16 is equivalent to 21/42...because proportions are nothing but equivalent fractions.
105/168 = r/8
cross multiply
(168)(r) = (105)(8)
168r = 840...divide both sides by 168
r = 840/168
r = 5