7p + 2r = 93
5p + 6r = 135
Times the first one by 3 to get an equal number of rulers so you get
21p + 6r = 279
5p + 6r = 135
Take the second one from the first and you should get
16p = 144
Divide 144 by 16 and the the weight of a pencil is 9 grams then you can substitute it into one of the first equations for example
7 times 9 + 2r = 93
63 + 2r = 93
Move the 63 across by taking it away from both sides to get 2r = 30 then divide 30 by two to get 15 which is how much a ruler ways
A) pencil = 9 grams
B) ruler = 15 grams