{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"Carol lives in a square house with side length (let\u0027s call it size) **N**. The width of the walls is negligible. Carol wants to cover the floor of her house with square floor mats. She found a shop online and ordered a mat of size **N**. However, the shop didn\u0027t have any mat of size **N**. So they sent her infinitely many square mats of size **1** to **(N - 1)**. Now Carol has to cover her house using these mats. She won\u0027t leave any empty space in her house, and no mat should go outside the floor (looks ugly, doesn\u0027t it?). The mats should not overlap each other. As you can guess, Carol wants to cover the floor using minimum number of mats."}},{"title":"Input","value":{"format":"MD","content":"Input starts with a single integer **T (1 ≤ T ≤ 20)**, denoting the number of test cases.\nEach case contains a single integer **N (2 ≤ N ≤ 50)**, denoting the size of the house."}},{"title":"Output","value":{"format":"MD","content":"For each test case, output a single line containing an integer **M**, denoting the minimal number of mats needed to cover the floor. \nIn the following **M** lines, print 3 space-separated integers **x**, **y**, and **i** indicating the coordinates of the top-left corner, and the size of the corresponding mat. Print the coordinates in their increasing order of x. If multiple coordinates have the same x, print them in their increasing order of y. \nNote: The top-left corner of the floor is **(1, 1)** and the bottom-right corner of the floor is **(N, N)**."}},{"title":"Sample Input","value":{"format":"MD","content":"`2`\n`3`\n`4`"}},{"title":"Sample Output","value":{"format":"MD","content":"`6`\n`1 1 2`\n`1 3 1`\n`2 3 1`\n`3 1 1`\n`3 2 1`\n`3 3 1`\n`4`\n`1 1 2`\n`1 3 2`\n`3 1 2`\n`3 3 2`"}},{"title":"Note","value":{"format":"MD","content":"An image showing the mat configuration for **N \u003d 3** can be found [here](https://postimg.cc/HJCyGxTd)."}}]}