The data is shown below.
A B K
1 2 3
The remaining 2 pens can go to different people
(3 ways – 1,1,0; 0,1,1; 1,0,1) or the same person (3 ways – 2,0,0; 0,2,0; 0,0,2).
Alternately, we can distribute the last 2 identical pens among the three of them using
x1+ x2+ x3 = 2, which has 4C2 non-negative integral solutions, i.e. 6.