Atcoder Beginner Contest 279 is a very good place to learn generating functions. The English version tutorial of 279Ex has already been posted on the MathStackExchange by a kind person. Unfortunately, the English tutorial on 279G is not available. Now I would like to make a second-hand tutorial on 279G based on PCTprobability's idea. I spend a huge amount of time understanding this idea. For contestants at about my level, it is quite difficult to understand
the idea even if it is written in English, let alone it is written in Japanese only (My Japanese is N5 level). I will make the following contributions.
(1)Write the tutorial in English. The original tutorial is in Japanese only. (2)Fill in the details. (3)Offer an accepted implementation.
I hope you and I can learn a lot from my blog.