There are three solutions.

Number of pencils = C Number of books = B
Number of Pens = P

Total Number of articles = 100 = C + P + B

C = 100 – P - B
-- equation 1

Total Purchase:

0.25 * C +
10 P + 25 * B = 1,000 ,
multiply by 4

C + 40 P + 100 B =
4,000 --- equation 2

From the above equations, we can infer that maximum value of P is 100, maximum
value of B is 40 and Maximum value of C is 100. Minimum of any of them is 1.
If the values are more than those maximum then equation 1 or 2 will not
be satisfied.

As C + 40 P + 100 B = 4,000 ,
substitute value of C from equation 1

100 - P - B + 40 P + 100 B = 4,000

39 P + 99 B = 3900
divide by 39

P + (33/13) B = 100
-- equation 3

Here, 100 is an integer. P is an integer. So
(33 B/13) is also an integer.

So B = 13, 26, or 39 only three
possibilities.

1) B = 13, P + 33 = 100, P = 67

C = 100 - 13 - 67 = 20.

Total purchase = 20*0.25 +10*67 + 13*25
= Rs 1,000

2) B = 26, P + 33 * 26/13 = P + 66 = 100, P = 34

C = 100 - 26 - 34 = 40

Total
purchase = 40*0.25+10*34+25*26 = Rs 1,000

3) B = 39 , P + 99 = 100, P = 1

C = 100 - 39 - 1 = 60

total purchase = 60*0.25 + 1 * 10 + 39 * 25 = Rs
1,000