Let the cost of 1 book be Rs. X and the cost of 1 pen be Rs. Y.
According to given conditions,
5x + 7y = 79 …(1)
and 7x + 5y = 77 …(2)
Adding equations (1) and (2), we get
12x + 12y = 156
or x + y = 13 ...(3)
Subtracting equations (2) and (1), we get
-2x + 2y = 2
implies x - y = - 1 ...(4)
On adding equations (3) and (4), we get
2x = 12
implies x = 6
Substituting x = 6 in equation (3), we get
6 + y = 13
y = 7
Total cost of 1 book and 2 pens = `1 xx 6 + 2 xx 7 = 6 + 14 = Rs. 20`