The Setup: This is a system of linear equations hiding behind ratios, with a strict Diophantine constraint: the prices of the pens and pencils must be positive integers. We have to decode two separate shopping trips, set up the algebra, and pin down the only integer solution.
Step 1: Formalize the second visit. On the second visit, the ratio of pens to pencils is 4:1, and the total cost is Rs. 112. We are explicitly told Ashok bought 4 pens. By the ratio, he must have bought exactly 1 pencil.
Let x be the price of a pen, and y be the price of a pencil.
4x+1y=112
Isolate y so we can use it as a substitution later:
y=112−4x
Step 2: Formalize the first visit. The ratio of pens to pencils bought is 2:3, costing Rs. 86. We don't know the exact quantities, just the ratio. So, let the quantities be 2k pens and 3k pencils, where k is a positive integer constant.
2kx+3ky=86⟹k(2x+3y)=86
Step 3: Substitute, then kill every wrong branch. Plug the isolated y from Step 1 into the Step 2 equation:
k(2x+3(112−4x))=86
k(2x+336−12x)=86⟹k(336−10x)=86
So 336−10x=k86, which forces k to be a positive factor of 86. The factors are 1,2,43,86, giving k86∈{86, 43, 2, 1} respectively. Now the kill shot: the left side 336−10x is 6 short of a multiple of ten, so it always ends in the digit 6 - and of those four candidates, only 86 does. That single observation eliminates k=2, k=43 and k=86 outright, with no trial-and-error, leaving k=1 as the one surviving branch.
336−10x=86⟹10x=250⟹x=25
Then y=112−4(25)=112−100=12. Both prices are positive integers, and since only one branch survived, this pair is unique.
Step 4: Reconcile against the first visit. Uniqueness is worth nothing if the numbers don't actually satisfy the original trip. With k=1 he bought 2 pens and 3 pencils: 2(25)+3(12)=50+36=86. That is exactly what he paid, so the pair holds.
Step 5: Calculate the final request. The prompt asks for the total amount paid *specifically for the pens* during the second visit.
He bought 4 pens at Rs. 25 each: 4×25=100.
Final Answer: 100