William comprehends that with all his activities he draws in increasingly more consideration from the trade's security group, so the number of his activities should not surpass 5000 and after each activity no factor can have a flat out esteem more noteworthy than 1018. William can perform activities of two kinds for two picked factors
Correct answer will be upvoted else downvoted.
William comprehends that with all his activities he draws in increasingly more consideration from the trade's security group, so the number of his activities should not surpass 5000 and after each activity no factor can have a flat out esteem more noteworthy than 1018. William can perform activities of two kinds for two picked factors with files I and j, where i<j:
Perform task
Perform task aj=aj−ai
William needs you to foster a system that will get every one of the interior factors to the ideal qualities.
Input
Each test contains numerous experiments. The main line contains the number of experiments t (1≤t≤20). Portrayal of the experiments follows.
The main line of each experiment contains a solitary even integer n (2≤n≤103), which is the number of interior factors.
The second line of each experiment contains n integers a1,a2,… ,an (1≤ai≤109), which are beginning upsides of inside factors.
Output
For each experiment print the appropriate response in the accompanying configuration:
The main line of output should contain the complete number of activities k, which the system will perform. Note that you don't need to limit k. The imbalance k≤5000 should be fulfilled.
Every one of the following k lines should contain activities arranged as "type I j", where "type" is equivalent to "1" if the procedure needs to play out a task of the main sort and "2" if the technique needs to play out a task of the subsequent kind. Note that i<j should hold.
Step by step
Solved in 3 steps with 1 images