Harder Gcd Problem
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

After solving the Basic Gcd Problem, ZYB gives you a more difficult one:

Given an integer , find two subset  and  of  such that:
  •  and 
  • Let  and , there exists two permutations  and  such that for each , .
Please find two subsets with maximum value of .

输入描述:

There are multiple test cases. The first line of input contains an integer , indicating the number of test cases. 
For each test case, there is only one line containing an integer  (
It's guaranteed that the sum of  of all test cases will not exceed .

输出描述:

For each test case, output an integer  in the first line. In the next  lines, each contains two integers a_i and b_i (), denoting the -th element in subset  and .
If there are multiple solutions, you can output any of them.
示例1

输入

复制
2
4
10

输出

复制
1
2 4
4
3 9
5 10
8 2
4 6