406339: GYM102367 A Cake Distribution
Description
You are about to have a birthday and you would like to prepare a birthday cake that weighs anywhere between $$$1$$$ and $$$10^{18}$$$ grams inclusive. You know that there will be $$$A$$$, $$$B$$$ or $$$C$$$ guests at the party. You would like to cut this cake into pieces such that:
- The weight of each piece is a positive integer number of grams.
- No matter how many guests arrive, the pieces can be distributed between the guests in such a way that each guest gets the same amount of cake. Note that some guests might get more than one piece.
You don't want to spend too much time cutting the cake, so you would like to have at most 5,000 pieces. Let's do it!
InputThe only line of input contains the 3 numbers $$$A$$$, $$$B$$$, $$$C$$$, all positive integers not more than $$$1000$$$.
OutputOn the first line, output one number $$$K$$$, the number of pieces. On each of the next $$$K$$$ lines, output a description of each piece, consisting of 4 numbers, $$$w_i$$$, $$$a_i$$$, $$$b_i$$$, $$$c_i$$$, where $$$w_i$$$ is the weight of the piece in grams and $$$a_i$$$, $$$b_i$$$, $$$c_i$$$ are indices of the person who will get this piece if $$$A$$$, $$$B$$$, or $$$C$$$ guests arrive, respectively. The indices should satisfy $$$1 \leq a_i \leq A$$$, $$$1 \leq b_i \leq B$$$, $$$1 \leq c_i \leq C$$$. The sum of all $$$w_i$$$s must be less than or equal to $$$10^{18}$$$.
ExampleInput1 2 3Output
4 2 1 1 1 1 1 1 2 1 1 2 2 2 1 2 3