Answer:
we will change the problem in stages
pre-place 1 in x1 & x4, and 4 in x2, thus guaranteeing their minimum requirements.
now 19 pencils remain to be distributed
when there are no restrictions on distributing n identical objects to k distinct piles, the formula is (n+k-1)C(k-1) which here translates to 22C3
finally, we need to see that x3 = 5, so we place 6 in x3 (guaranteeing that it violates the condition), and subtract such violations, ie (22-6)C3 = 16C3
ans: 22C3 - 16C3 = 980