TSHIRTS - Editorial

Here is my attempt to explain the approach to an exactly similar problem
Tshirt Codechef

Can pls someone tell how to take the input.Like in the first case,how would we know if a person has 2 or 3 tshirts.How do i know that the next tshirt is for another guy.