**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
#include<bits/stdc++.h>

using namespace std;
#define ll long long
#pragma optimize ("O3")

ll mult(ll a,ll b ,ll mod){return ((a%mod) * (b%mod))% mod;}
ll add(ll a,ll b ,ll mod){return ((a%mod) + (b%mod))% mod;}
ll binpow(ll base,ll exp,ll mod){ll res=1;while(exp>0){if(exp & 1)res=mult(res,base,mod);base= mult(base,base,mod);exp>>=1;}return res;}
ll binpow(ll base,ll exp){ll res=1;while(exp>0){if(exp & 1)res=res*base;base= base*base;exp>>=1;}return res;}

const ll mod=1e9+7;
const ll INF=2e17;
const int OL =8e3+6;

int dir1[]={1,0,-1,0};
int dir2[]={0,1,0,-1};
//do not forget about cin>>t; down there !!!

void solve(){
    //6:47
    //7 : 8
    vector<pair<int,int>>ans;
    int n;
    cin>>n;
    if(n==1){
        n =11;
        for(int i=1;i<10001;i++){
            ll a = i+1,b= i;
            if((a>1e4)||b<=min(10000LL,a*n)){
                ans.push_back({a,b});
            }
            else break;
        }
    }
    string s=to_string(n);
    int len = s.length();
    ll tmp = 0;
    int ptr = 0;
    ll cur=0;

    while(true){
        int d = s[ptr] - '0';
        ptr++;
        ptr %=len;
        tmp ++;
        cur *= 10;
        cur += d;

        ll a = (cur-tmp)/(n-len);
        ll b = a*len-tmp;

        //cout<<a<<endl;
        if((a>1e4)||b>min(10000LL,n*a))break;
        if(b<1||a*n-b!=cur);
        else ans.push_back({a,b});

    }
    cout<<ans.size()<<'\n';
    for(auto p:ans)cout<<p.first<<" "<<p.second<<'\n';
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int t = 1;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the buggy code, we need to focus on edge cases where the string multiplication and subtraction operations might differ significantly from the integer operations. The key points to consider are:

1. **Large Values of \( n \)**: These can lead to long strings when multiplied by \( a \), making the string operations more complex.
2. **Edge Cases for \( a \) and \( b \)**: Values of \( a \) and \( b \) that push the limits of the constraints (1 ≤ \( a \) ≤ 10000 and 1 ≤ \( b \) ≤ min(10000, \( a \cdot n \))).
3. **Special Values of \( n \)**: Values of \( n \) that might cause the string operations to behave unexpectedly, such as \( n = 1 \) or \( n = 10 \).

Given the constraints and the nature of the bug, let's create a test input that includes these edge cases.

### Test Input
```plaintext
3
1
10
99
```

### Explanation
1. **\( n = 1 \)**:
   - When \( n = 1 \), the string representation of \( n \) is "1". Multiplying "1" by \( a \) results in a string of \( a \) ones. This can lead to interesting cases where the subtraction of \( b \) characters from the string might differ from the integer subtraction.
   - Example: \( a = 20 \), \( b = 18 \) should result in "22" as the correct answer, but the string operation might give a different result.

2. **\( n = 10 \)**:
   - When \( n = 10 \), the string representation of \( n \) is "10". Multiplying "10" by \( a \) results in a string of "10" repeated \( a \) times. This can lead to complex string operations.
   - Example: \( a = 100 \), \( b = 990 \) should result in "10" as the correct answer, but the string operation might give a different result.

3. **\( n = 99 \)**:
   - When \( n = 99 \), the string representation of \( n \) is "99". Multiplying "99" by \( a \) results in a string of "99" repeated \( a \) times. This can lead to very long strings, making the subtraction of \( b \) characters more complex.
   - Example: \( a = 101 \), \( b = 9999 \) should result in "99" as the correct answer, but the string operation might give a different result.

This test input is designed to challenge the buggy code by pushing it to handle edge cases and large values, where the string operations might differ significantly from the integer operations.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
#include <bits/stdc++.h>
using namespace std;
int main(){
    //जय श्री राम ||
   int t;
   cin>>t;
   while(t--){
        int n;
        cin>>n;
        int dig=n/10+1;
        int diff=n-dig;

        if(diff==0){
            int maxi=1e4;
            cout<<"9999"<<endl;
            while(maxi>1){
                cout<<maxi<<" "<<maxi-1<<endl;
                maxi--;
            }

        }
        else{
            string s="";
            string num=to_string(n);
            int i=0;
            int count=0;
            vector<pair<int,int>>ans;
            while(s.length()<=8){
                s+=num[i%dig];
                i++;
                int len=s.length();
                int val=stoi(s);
                if((val-len)%diff!=0)continue;
                int a=(val-len)/diff;
                int b=(dig*a)-len;
                if(b>=1 && b<=1e4){
                    ans.push_back({a,b});
                    count++;
                }
            }
            cout<<count<<endl;
            for(auto i:ans)cout<<i.first<<" "<<i.second<<endl;
        }
    }
    return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To expose the bug in the provided code, we need to focus on edge cases where the string manipulation and integer subtraction might lead to incorrect results. The key is to find values of `n`, `a`, and `b` where the string manipulation and integer arithmetic yield the same result, but the code's logic fails to handle these cases correctly.

### Step-by-Step Analysis:

1. **Understanding the Bug**:
   - The code incorrectly treats `n` as a string and performs string concatenation and subtraction.
   - The correct result should be an integer `n * a - b`.

2. **Edge Cases**:
   - **Single-digit `n`**: When `n` is a single digit, the string manipulation is simpler and might not expose the bug as easily.
   - **Multi-digit `n`**: When `n` is multi-digit, the string manipulation becomes more complex and is more likely to expose the bug.
   - **Special values of `a` and `b`**: Values that make `n * a - b` a multi-digit number and then subtract `b` from it.

3. **Test Input**:
   - We will choose a multi-digit `n` and values of `a` and `b` that should correctly satisfy the condition `n * a - b` but might fail in the string manipulation logic.

### Chosen Test Input:
Let's choose `n = 21` and test with a few values of `a` and `b` that should work correctly:

```plaintext
3
21
21
21
```

### Explanation:
- For `n = 21`:
  - If `a = 10` and `b = 190`, the correct result is `21 * 10 - 190 = 210 - 190 = 20`.
  - The string manipulation should be `"21" * 10 = "212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
for _ in range(int(input())):
    n = int(input())
    sn = str(n)
    lenN = len(str(n))
    ans = []
    for a in range(1, 10001):
        minB = max(1, lenN * a - 5)
        maxB = lenN * a
        for b in range(minB, maxB):
            x = n * a - b
            y = 0
            for i in range(lenN * a - b):
                y = y * 10 + int(sn[i % lenN])
            if x == y:
                ans.append((a, b))
    print(len(ans))
    for p in ans:
        print(*p)

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the buggy code, we need to focus on edge cases and scenarios where the string manipulation and integer arithmetic can lead to significant differences. Here are the steps to consider:

1. **Edge Cases for `n`**:
   - Small values of `n` (e.g., 1, 2) to test the basic behavior.
   - Large values of `n` (e.g., 99, 100) to test the limits of the string manipulation and integer arithmetic.

2. **Edge Cases for `a` and `b`**:
   - Values of `a` that are close to the upper limit (10000) to maximize the length of the string.
   - Values of `b` that are just below the length of the string to test the subtraction logic.

3. **Special Cases**:
   - Values of `n` that result in repeated digits (e.g., 11, 22) to test the string pattern.
   - Values of `a` and `b` that result in a non-empty string after subtraction and match the correct integer result.

Based on these considerations, here is a small-scale test input that should expose the bug:

```plaintext
3
1
11
99
```

### Explanation:
1. **Test Case 1: `n = 1`**
   - For `n = 1`, the string representation is "1".
   - The length of the string is 1.
   - For `a = 10000`, the string `s` will be "1111...1" (10000 times).
   - For `b = 9999`, the string `s` after subtraction will be "1", which matches the correct integer result `1 * 10000 - 9999 = 1`.

2. **Test Case 2: `n = 11`**
   - For `n = 11`, the string representation is "11".
   - The length of the string is 2.
   - For `a = 10000`, the string `s` will be "111111...1111" (10000 times, each "11" repeated 10000 times).
   - For `b = 19998`, the string `s` after subtraction will be "11", which matches the correct integer result `11 * 10000 - 19998 = 11`.

3. **Test Case 3: `n = 99`**
   - For `n = 99`, the string representation is "99".
   - The length of the string is 2.
   - For `a = 10000`, the string `s` will be "999999...9999" (10000 times, each "99" repeated 10000 times).
   - For `b = 19998`, the string `s` after subtraction will be "99", which matches the correct integer result `99 * 10000 - 19998 = 99`.

These test cases should effectively expose the bug in the buggy code by creating scenarios where the string manipulation and integer arithmetic lead to different results.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
def Single(n, c):
    n1 = ""
    for i in range(c):
        n1 += str(n)
    n2 = n*c
    i = 0
    while n2 < int(n1):
        n2 += n - 1
        i += 1
        if i+c == 10000:
            return -1
    if n2 == int(n1):
        return i
    return 0

def Double(n, c):
    #print("New Run")
    n1 = ""
    c2 = int((c-(c%2))/2)
    #print("Repeating", c2, "times")
    i = 2
    for j in range(c2):
        n1 += str(n)
    if c%2 == 1:
        n1 += (str(n))[0]
        i -= 1
        #print("Adding extra", (str(n))[0])
    #print("Expecting", n1)
    #print("Starting b value:", i)
    n2 = n*int((i+c)/2)-i
    #print("Starting n2 value:", n2)
    #print("N interval of", n-2)
    while n2 < int(n1):
        n2 += n - 2
        i += 2
        if i == 10000 or int((i+c)/2)==10000:
            #print("Got here, b is", i, "and a is", int((i+c)/2))
            return -1
    if n2 == int(n1):
        return i
    return 0

t = int(input())
for i in range(t):
    n = int(input())
    if n < 10:
        c = 2
        f = Single(n, c)
        ans1 = 0
        ans2 = []
        while f != -1:
            if f != 0:
                ans1 += 1
                ans2.append(str(f+c)+" "+str(f))
            c += 1
            f = Single(n, c)
        print(ans1)
        for j in range(ans1):
            print(ans2[j])
    else:
        c = 1
        f = Double(n, c)
        ans1 = 0
        ans2 = []
        while f != -1:
            if f != 0:
                ans1 += 1
                ans2.append(str(int((f+c)/2))+" "+str(f))
            c += 1
            #print("Proceed to next, c is", c, "and f was", f)
            f = Double(n, c)
        print(ans1)
        for j in range(ans1):
            print(ans2[j])

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1
9
10
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
// Source: https://usaco.guide/general/io

import java.io.*;
import java.util.*;

// Source: https://usaco.guide/general/io

import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		int T = sc.nextInt();

		while(T-- > 0){
			List<String> sols = new ArrayList<String>();
			int N = sc.nextInt();
			// Brute force
			// The string can have length at most 8
			int L = Integer.toString(N).length();
			for(int endLength = 1; endLength < 8; endLength++){
				int endNum = Integer.parseInt(Integer.toString(N).repeat(endLength/L) + Integer.toString(N).substring(0,endLength%L));

				//(N - L) * A + endLength = endNum
				//sols.add(N + " " + L + " " + endLength + " " + endNum);
				if((endNum - endLength)%(N - L) == 0){
					int A = (endNum - endLength)/(N - L);
					if(1 <= A && A <= 10000 && (1 <= L * A - endLength && L * A - endLength <= 10000)){
						//System.out.println(A + " " + (L * A - endLength));
						sols.add(A + " " + (L * A - endLength));
					}
				}
			}
			System.out.println(sols.size());
			for(String sol : sols){
				System.out.println(sol);
			}

		}

	}
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the buggy code, we need to consider edge cases and scenarios that maximize the failure probability. The key issue in the buggy code is the incorrect handling of the string multiplication and subtraction operations. Here are the steps to create such a test input:

1. **Small \( n \) Values**: Test with small values of \( n \) where the string representation of \( n \) is a single digit. This can help in easily identifying the incorrect behavior of the string operations.
2. **Large \( n \) Values**: Test with larger values of \( n \) where the string representation of \( n \) has multiple digits. This can expose issues in the string manipulation logic.
3. **Special \( a \) and \( b \) Values**: Test with \( a \) and \( b \) values that are close to the upper limits to ensure the string operations are handled correctly.
4. **Edge Cases**: Test with values that are on the boundary conditions, such as \( n = 1 \) or \( n = 100 \).

Given the constraints and the need for a small-scale test input, here is a suitable test input:

```plaintext
4
1
10
99
100
```

### Explanation:
- **Test Case 1: \( n = 1 \)**
  - This is the smallest possible value for \( n \). It should be easy to handle but can expose issues if the string operations are not correctly implemented.
- **Test Case 2: \( n = 10 \)**
  - This is a two-digit number. The string representation of \( n \) will be "10", and the string operations should be carefully handled.
- **Test Case 3: \( n = 99 \)**
  - This is a larger two-digit number. It can help in testing the string operations with a larger number of digits.
- **Test Case 4: \( n = 100 \)**
  - This is the largest possible value for \( n \). It should be the most challenging case to handle due to the length of the string representation.

This test input should help in identifying the issues in the buggy code by covering a range of \( n \) values and their corresponding string manipulations.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws IOException {
		FastIO io = new FastIO();
		int T = io.nextInt();

		for (int t = 0; t < T; t++) {
			int N = io.nextInt();
			String dig = (N + "");
			int digCnt = dig.length();

			ArrayList<long[]> ans = new ArrayList<>();
			for (int X = 2; X <= 5; X++) {
				StringBuilder big = new StringBuilder("");
				for (int j = 0; j < X; j += digCnt) {
					for (int k = 0; k < digCnt && j + k < X; k++) {
						big.append(dig.charAt(k));
					}
				}
				long bigNum = Long.parseLong(big.toString());
				for (long B = 1; B <= 1e4; B++) {
					if ((bigNum + B) % N == 0) {
						long A = (bigNum + B) / N;
						if (A * digCnt - B != X) continue;
						if (A <= 1e4 && B <= 1e4) {
							ans.add(new long[] {A, B});
						}
					}
				}
			}

			io.println(ans.size());
			for (int i = 0; i < ans.size(); i++) {
				io.println(ans.get(i)[0] + " " + ans.get(i)[1]);
			}
		}

		io.close();
	}
}

class FastIO extends PrintWriter {

	private InputStream stream;

	private byte[] buf = new byte[1 << 16];

	private int curChar;

	private int numChars;

	// standard input

	public FastIO() { this(System.in, System.out); }

	public FastIO(InputStream i, OutputStream o) {

		super(o);

		stream = i;

	}

	// file input

	public FastIO(String i, String o) throws IOException {

		super(new FileWriter(o));

		stream = new FileInputStream(i);

	}

	// throws InputMismatchException() if previously detected end of file

	private int nextByte() {

		if (numChars == -1) { throw new InputMismatchException(); }

		if (curChar >= numChars) {

			curChar = 0;

			try {

				numChars = stream.read(buf);

			} catch (IOException e) { throw new InputMismatchException(); }

			if (numChars == -1) {

				return -1;  // end of file

			}

		}

		return buf[curChar++];

	}

	// to read in entire lines, replace c <= ' '

	// with a function that checks whether c is a line break

	public String next() {

		int c;

		do { c = nextByte(); } while (c <= ' ');

		StringBuilder res = new StringBuilder();

		do {

			res.appendCodePoint(c);

			c = nextByte();

		} while (c > ' ');

		return res.toString();

	}

	public int nextInt() {  // nextLong() would be implemented similarly

		int c;

		do { c = nextByte(); } while (c <= ' ');

		int sgn = 1;

		if (c == '-') {

			sgn = -1;

			c = nextByte();

		}

		int res = 0;

		do {

			if (c < '0' || c > '9') { throw new InputMismatchException(); }

			res = 10 * res + c - '0';

			c = nextByte();

		} while (c > ' ');

		return res * sgn;

	}

	public long nextLong() {  // nextLong() would be implemented similarly

		int c;

		do { c = nextByte(); } while (c <= ' ');

		int sgn = 1;

		if (c == '-') {

			sgn = -1;

			c = nextByte();

		}

		long res = 0;

		do {

			if (c < '0' || c > '9') { throw new InputMismatchException(); }

			res = 10 * res + c - '0';

			c = nextByte();

		} while (c > ' ');

		return res * sgn;

	}

	public double nextDouble() { return Double.parseDouble(next()); }

}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the given buggy code, we need to focus on edge cases and scenarios that maximize the failure probability. The bug in the code is that it treats `n` as a string, which can lead to incorrect calculations when `n` is multiplied by `a` and `b` is subtracted from the resulting string.

### Steps to Generate the Test Input

1. **Small `n` values**: Test with small values of `n` (e.g., 1, 2, 3) to ensure the string manipulation does not accidentally work correctly.
2. **Large `n` values**: Test with large values of `n` (e.g., 99, 100) to ensure the string manipulation causes significant differences.
3. **Edge cases for `a` and `b`**: Test with values of `a` and `b` that are close to the limits (e.g., 1, 10000) to see if the string manipulation still works as expected.
4. **Special values**: Test with values that might cause unexpected behavior, such as `n = 10` or `n = 11`.

### Test Input

```plaintext
3
1
99
10
```

### Explanation

1. **n = 1**: This is a very simple case. The string "1" multiplied by any `a` will just repeat "1" `a` times. Subtracting `b` from this string should be straightforward, but it's a good starting point.
2. **n = 99**: This is a large value. The string "99" multiplied by any `a` will result in a very long string. Subtracting `b` from this string will be more complex and likely to expose the bug.
3. **n = 10**: This is a special case where the string "10" multiplied by any `a` will result in a string of "10" repeated `a` times. This can cause issues with the string manipulation, especially when `b` is large.

This test input is small and complete, and it should effectively expose the bug in the buggy code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void see(T &...args) { ((cin >> args), ...); }
template <typename... T>
void put(T &&...args) { ((cout << args << " "), ...); }
template <typename... T>
void putl(T &&...args)
{
    ((cout << args << " "), ...);
    cout << '\n';
}
#define error(args...)                           \
    {                                            \
        string _s = #args;                       \
        replace(_s.begin(), _s.end(), ',', ' '); \
        stringstream _ss(_s);                    \
        istream_iterator<string> _it(_ss);       \
        err(_it, args);                          \
    }
void err(istream_iterator<string> it)
{
}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << "=" << a << ", ";
    err(++it, args...);
}
#define int long long
#define endl "\n"
#define pb push_back
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair<int, int>
#define tiii tuple<int, int, int>
#define vi vector<int>
#define vii vector<pii>
#define vvi vector<vi>
#define vc vector
#define E cerr << '\n';
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define rev(i, a, b) for (int i = a; i > b; --i)
#define IOS                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
#define setpr(x) cout << setprecision(x) << fixed
#define seea(a, x, y)           \
    for (int i = x; i < y; i++) \
    {                           \
        cin >> a[i];            \
    }
#define seev(v, n)              \
    for (int i = 0; i < n; i++) \
    {                           \
        int x;                  \
        cin >> x;               \
        v.push_back(x);         \
    }
#define sees(s, n)              \
    for (int i = 0; i < n; i++) \
    {                           \
        int x;                  \
        cin >> x;               \
        s.insert(x);            \
    }
const ll inf = LLONG_MAX;
const ld ep = 0.0000001;
const ld pi = acos(-1.0);
const ll md = 998244353;
const ll mod = 1000000007;
#define djq 1000000007

// #define P complex<int>
// #define X real()
// #define Y imag()

inline int ksm(int base, int p) {int ret = 1; while (p) {if (p & 1)ret = 1ll * ret * base % djq; base = 1ll * base * base % djq, p >>= 1;} return ret;}
inline void pls(int& x, const int k) { x = (x + k >= djq ? x + k - djq : x + k); }
inline int add(const int a, const int b) { return a + b >= djq ? a + b - djq : a + b; }
inline void sub(int& x, const int k) { x = (x - k < 0 ? x - k + djq : x - k); }
inline int inc(const int a, const int b) { return a < b ? a - b + djq : a - b; }
inline void ckmn(int& x, const int k) { x = (k < x ? k : x); }
inline void ckmx(int& x, const int k) { x = (k > x ? k : x); }
const int lim = 2e5;

// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// template <class T>
// using Tree = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
// tree

// int dp[200005][20];

// void constructST(int a[], int n)
// {
//     for (int i = 0; i < n; i++)
//         dp[i][0] = a[i];
//     for (int j = 1; j <= 19; j++)
//         for (int i = 0; (i + (1 << j)) <= n; i++)
//             dp[i][j] = min(dp[i][j - 1], dp[i + (1 << (j - 1))][j - 1]);
// }

// struct edge
// {
//     int L;
//     int R;
//     int id;
//     edge(int a, int b, int c)
//     {
//         L = a;
//         R = b;
//         id = c;
//     }
// };

// const int N = 1e7 + 5;
// vector<int> smallest_prime_factor(N, 1);
// void calculate_smallest_prime_factor() {
//     int N = 1e7;
//     for (int i = 2; i <= N; i++) {
//         if (dp[i] == 1) {
//             dp[i] = i;
//             for (int j = i + i; j <= N; j += i) {
//                 if (dp[j] == 1) {
//                     dp[j] = i;
//                 }
//             }
//         }
//     }
// }

// const int N = 2000007;
// int f[N], rf[N];
// int C(int u, int v) {
//     if (u < v || u < 0 || v < 0) return 0ll;
//     return ((f[u] * rf[u - v] % mod) * rf[v]) % mod;
// }

// const ll MAXM = 1e5;
// vector<ll> factors[MAXM + 5];
// void init() {
//     for (ll i = 1; i <= MAXM; i++) {
//         for (ll j = i; j <= MAXM; j += i) {
//             factors[j].pb(i);
//         }
//     }
// }

// const int mxN = 1e7 + 6;
// int spf[mxN];
// void sieve() {
//     spf[0] = 1;
//     for (int i = 1; i < mxN; i++)
//         spf[i] = i;
//     for (int i = 2; i * i < mxN; i++) {
//         if (spf[i] == i) {
//             for (int j = i * i; j < mxN; j += i) {
//                 if (spf[j] == j)
//                     spf[j] = i;
//             }
//         }
//     }
// }

// long long  power(long long base, long long exp, long long modulus = inf) {
//     base %= modulus;
//     long long result = 1;
//     while (exp > 0) {
//         if (exp & 1) result = (result * base) % modulus;
//         base = (base * base) % modulus;
//         exp >>= 1;
//         exp %= modulus;
//     }
//     return result;
// }

// vector<int> topo(int n, vector<vector<int>> &adj)
// {
//     vector<int> indegree(n, 0);
//     for (int i = 0; i < n; i++) {
//         for (auto it : adj[i]) {
//             indegree[it]++;
//         }
//     }
//     priority_queue<int, vector<int>, greater<int>> q;
//     for (int i = 0; i < n; i++) {
//         if (indegree[i] == 0) {
//             q.push(i);
//         }
//     }
//     vector<int> topo;
//     while (!q.empty()) {
//         int node = q.top(); q.pop();
//         topo.push_back(node);
//         for (auto i : adj[node]) {
//             indegree[i]--;
//             if (indegree[i] == 0) {
//                 q.push(i);
//             }
//         }
//     }
//     // if (topo.size() == n) return topo;
//     // return {};
//     return topo;
// }

// vector<int> lps_array(string s) {
//     int m = s.size();
//     vector<int> lps(m, 0);
//     int i = 1;
//     int len = 0;
//     while (i < m) {
//         if (s[i] == s[len]) {
//             len++;
//             lps[i] = len;
//             i++;
//         }
//         else {
//             if (len != 0) {
//                 len = lps[len - 1];
//             }
//             else {
//                 lps[i] = 0;
//                 i++;
//             }
//         }
//     }
//     return lps;
// }

long long highestPowerof2(long long N)
{
    // if N is a power of two simply return it
    if (!(N & (N - 1)))
        return N;
    // else set only the most significant bit
    return 0x8000000000000000 >> (__builtin_clzll(N));
}

// vector<vector<int>> mul(vector<vector<int>> a, vector<vector<int>> b) {
//     int n = a.size();
//     vector<vector<int>> c(n, vector<int> (n, 0));
//     for (int i = 0; i < n; i++) {
//         for (int j = 0; j < n; j++) {
//             for (int k = 0; k < n; k++) {
//                 (c[i][j] += a[i][k] * b[k][j] % mod) %= mod;
//             }
//         }
//     }
//     return c;
// }
// vector<vector<int>> exp(vector<vector<int>> x, int y) {
//     int n = x.size();
//     vector<vector<int>> res(n, vector<int> (n, 0));
//     for (int i = 0; i < n; i++) {
//         res[i][i] = 1;
//     }
//     while (y > 0) {
//         if (y & 1) {
//             res = mul(res, x);
//         }
//         y = y >> 1;
//         x = mul(x, x);
//     }
//     return res;
// }

long long nearestPowerOf2(long long N)
{
    long long a = log2(N);
    if (pow(2, a) == N)
        return N;
    return pow(2, a + 1);
}

// vector<int> z_arr(string s) {
//     int n = s.size();
//     vector<int> z(n);
//     int x = 0, y = 0;
//     for (int i = 1; i < n; i++) {
//         z[i] = max(0LL, min(z[i - x], y - i + 1));
//         while (i + z[i] < n && s[z[i]] == s[i + z[i]]) {
//             x = i; y = i + z[i]; z[i]++;
//         }
//     }
//     return z;
// }

// const int N = 131072;
// int arr[N];
// int seg[N * 2][41];

// void build(int n) {
//     for (int i = 0; i < n; i++) {
//         for (int k = 1; k <= 40; k++) {
//             seg[i + n][k] = arr[i] == k;
//         }
//     }
//     for (int i = n - 1; i > 0; i--) {
//         // seg[i][0] = (seg[2 * i][0] + seg[2 * i + 1][0]);
//         for (int k = 1; k <= 40; k++) {
//             seg[i][k] = seg[i * 2][k] + seg[i * 2 + 1][k];
//         }
//     }
// }

// int find(int a, int b, int n) {
//     if (a > b) return 0;
//     a += n; b += n;
//     int s = 0;
//     while (a <= b) {
//         if (a % 2 == 1) {
//             // s = (s + seg[a][0]);
//             s = mul(s, seg[a]);
//             a++;
//         }
//         if (b % 2 == 0) {
//             // s = (s + seg[b][0]);
//             s2 = mul(seg[b], s2);
//             b--;
//         }
//         a /= 2; b /= 2;
//     }
//     return mul(s, s2);
// }

// void update(int ind, int u, int n) {
//     ind += n;
//     seg[ind][arr[ind - n]] = 0;
//     seg[ind][u] = 1;
//     arr[ind - n] = u;
//     for (int i = ind / 2; i >= 1; i /= 2) {
//         for (int k = 1; k <= 40; k++) {
//             seg[i][k] = seg[i * 2][k] + seg[i * 2 + 1][k];
//         }
//     }
// }

// class TrieNode {
// public:
//     TrieNode *child[2];
//     int cnt;
//     set<int> s;
//     TrieNode() {
//         for (auto &a : child) a = nullptr;
//         cnt = 0;
//     }
// };

// TrieNode *root = new TrieNode();
// void insert(string n, int ind) {
//     TrieNode *p = root;
//     for (char c : n) {
//         int i = c - '0';
//         if (!p->child[i]) p->child[i] = new TrieNode();
//         p = p->child[i];
//         p->cnt++;
//         p->s.insert(ind);
//     }
// }

// int search(string n) {
//     TrieNode *p = root;
//     bool parted = false;
//     for (char c : n) {
//         int i = c - '0';
//         if (parted) {
//             p = p->child[i];
//         }
//         else {
//             if (p->child[i]->cnt == 1) {
//                 p = p->child[1 - i];
//                 parted = true;
//             }
//             else {
//                 p = p->child[i];
//             }
//         }
//     }
//     return *p->s.begin();
// }

void solve() {
    int N; cin >> N;
    string n = to_string(N);
    int curr = 0;
    vector<pair<int, int>> ans;
    for (int i = 1; i <= 7; i++) {
        curr = curr * 10 + (n[(i - 1) % n.size()] - '0');
        // cout << curr << endl;
        if ((curr - i) % (N - n.size())) continue;
        int a = (curr - i) / (N - n.size());
        int b = N * a - curr;
        // cout << curr << " " << a << " " << b << endl;
        if (a <= 10000 && b <= min(10000ll, a * N) && a > 0 && b > 0) {
            ans.push_back({a, b});
        }
    }
    cout << ans.size() << endl;
    for (auto it : ans) {
        cout << it.first << " " << it.second << endl;
    }
}

signed main()
{
    // f[0] = 1;
    // for (int i = 1; i < N; ++i) f[i] = f[i - 1] * i % mod;
    // rf[N - 1] = power(f[N - 1], mod - 2, mod);
    // for (int i = N - 1; i > 0; --i) rf[i - 1] = rf[i] * i % mod;

    // init();

    // sieve();

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifdef ONLINEJUDGE
    clock_t tStart = clock();
    freopen("input.txt", "r", stdin);   // can need to change file . this one for taking input
    freopen("output.txt", "w", stdout); // this one for output
#endif

    int T = 1;
    cin >> T;
    // // int cnt = 1;
    while (T--) {
        solve();
    }

#ifdef ONLINEJUDGE
    fprintf(stderr, "\n>> Runtime: %.10fs\n", (double)(clock() - tStart) / CLOCKS_PER_SEC); // this line gives your code runtime
#endif

    return 0;
}

// Why must I suffer so

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the buggy code, we need to focus on edge cases where the string manipulation and integer arithmetic might lead to different results. Specifically, we need to find values of \(a\) and \(b\) such that the string manipulation in the buggy code produces a string that, when converted to an integer, equals the correct answer \(n \cdot a - b\).

### Steps to Generate the Test Input:
1. **Understand the Bug**:
   - The buggy code treats \(n\) as a string and performs string concatenation and substring removal.
   - The correct solution should perform integer arithmetic.

2. **Identify Edge Cases**:
   - **Single-digit \(n\)**: This is straightforward and less likely to expose the bug.
   - **Multi-digit \(n\)**: More likely to expose the bug due to the nature of string concatenation.
   - **Boundary Values**:
     - \(a\) and \(b\) should be within the constraints \(1 \le a \le 10000\) and \(1 \le b \le \min(10000, a \cdot n)\).
     - Values of \(a\) and \(b\) that result in a string length that is just enough to be manipulated to the correct answer.

3. **Generate Test Cases**:
   - Choose a multi-digit \(n\) and find pairs \((a, b)\) that satisfy the conditions.

### Chosen Test Input:
- \(n = 12\)
- We need to find pairs \((a, b)\) such that the string manipulation in the buggy code results in a string that, when converted to an integer, equals \(12 \cdot a - b\).

### Example Pairs:
- \(a = 100\), \(b = 1200\):
  - \(12 \cdot 100 - 1200 = 0\)
  - String manipulation: "12" repeated 100 times, then removing 1200 characters results in an empty string, which is incorrect.
- \(a = 101\), \(b = 1212\):
  - \(12 \cdot 101 - 1212 = 0\)
  - String manipulation: "12" repeated 101 times, then removing 1212 characters results in an empty string, which is incorrect.
- \(a = 102\), \(b = 1224\):
  - \(12 \cdot 102 - 1224 = 0\)
  - String manipulation: "12" repeated 102 times, then removing 1224 characters results in an empty string, which is incorrect.
- \(a = 103\), \(b = 1236\):
  - \(12 \cdot 103 - 1236 = 0\)
  - String manipulation: "12" repeated 103 times, then removing 1236 characters results in an empty string, which is incorrect.

### Test Input:
```plaintext
1
12
```

### Expected Output:
```plaintext
4
100 1200
101 1212
102 1224
103 1236
```

This test input should expose the bug in the buggy code by providing values of \(a\) and \(b\) that result in an incorrect string manipulation, leading to an empty string or an incorrect result when converted to an integer.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long int ll;
typedef pair<int,int> ii;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef tuple<int, int, int> iii;
#define LSOne(S) ((S)&-(S))
const int inf = 1e9;
typedef long double ld;
const ld EPS = 1e-9;
void precompute(){
	ofstream ofile;
	ofile.open("output.txt");
	for(ll n = 1; n <= 100; n++){
		cout<<n<<'\n';
		vector<pl> ans;
		string s = "";
		for(ll a = 1; a <= 10000; a++){
			s += to_string(n);
			for(ll b = 1; b <= min(10000ll, a * n); b++){
				ll val = n * a - b;
				if(val<0)continue;
				if(s.length() - b <= 0 || s.length() - b > 7)continue;
				string ss = s;
				for(int i=0;i<b;i++)ss.pop_back();
				if(val == stoll(ss))
					ans.push_back({a, b});
			}
		}
		cout<<n<<' '<<ans.size()<<'\n';
		ofile<<"\""<<n<<' '<<ans.size()<<"\\n\""<<'\n';
		for(auto [a, b] : ans){
			cout<<a<<' '<<b<<'\n';
			ofile<<"\""<<a<<' '<<b<<"\\n\""<<'\n';
		}
	}
	ofile.close();
}
string precomputed =
"2 3\n"
"20 18\n"
"219 216\n"
"2218 2214\n"
"3 1\n"
"165 162\n"
"4 3\n"
"14 12\n"
"147 144\n"
"1480 1476\n"
"5 1\n"
"138 135\n"
"6 0\n"
"7 1\n"
"129 126\n"
"8 0\n"
"9 0\n"
"10 1\n"
"1262 2519\n"
"11 3\n"
"12 21\n"
"123 242\n"
"1234 2463\n"
"12 0\n"
"13 1\n"
"119 234\n"
"14 1\n"
"1178 2351\n"
"15 0\n"
"16 1\n"
"1154 2303\n"
"17 0\n"
"18 1\n"
"1136 2267\n"
"19 0\n"
"20 1\n"
"112 220\n"
"21 1\n"
"11 19\n"
"22 0\n"
"23 0\n"
"24 1\n"
"110 216\n"
"25 0\n"
"26 0\n"
"27 0\n"
"28 0\n"
"29 0\n"
"30 0\n"
"31 0\n"
"32 0\n"
"33 0\n"
"34 0\n"
"35 1\n"
"107 210\n"
"36 0\n"
"37 0\n"
"38 0\n"
"39 0\n"
"40 0\n"
"41 0\n"
"42 0\n"
"43 0\n"
"44 0\n"
"45 0\n"
"46 0\n"
"47 0\n"
"48 0\n"
"49 0\n"
"50 0\n"
"51 0\n"
"52 0\n"
"53 0\n"
"54 0\n"
"55 0\n"
"56 0\n"
"57 0\n"
"58 0\n"
"59 0\n"
"60 0\n"
"61 0\n"
"62 0\n"
"63 0\n"
"64 0\n"
"65 0\n"
"66 0\n"
"67 0\n"
"68 1\n"
"104 204\n"
"69 0\n"
"70 0\n"
"71 0\n"
"72 0\n"
"73 0\n"
"74 0\n"
"75 0\n"
"76 0\n"
"77 0\n"
"78 0\n"
"79 0\n"
"80 0\n"
"81 0\n"
"82 0\n"
"83 0\n"
"84 0\n"
"85 0\n"
"86 0\n"
"87 0\n"
"88 0\n"
"89 0\n"
"90 1\n"
"1033 2061\n"
"91 0\n"
"92 0\n"
"93 0\n"
"94 1\n"
"1032 2059\n"
"95 0\n"
"96 0\n"
"97 0\n"
"98 0\n"
"99 0\n"
"100 0\n";
vector<vector<pl>> ans(101, vector<pl>());
void solve(){
	string line;
	int idx = 0;
	int len = 0;
	istringstream iss(precomputed);
	while(getline(iss, line)){
		vll v = views::split(line,' ')
			  | views::transform([](auto r){return stoll(r | std::ranges::to<std::string>());})
			  | ranges::to<std::vector>();
		if(!len){
			idx = v[0];
			len = v[1];
		}else{
			--len;
			ans[idx].push_back({v[0], v[1]});
		}
	}
	int tc;cin>>tc;
	while(tc--){
		int n;cin>>n;
		if(n==1){
			cout<<1<<' '<<9999<<'\n';
			for(int i=2;i<=10000;i++){
				cout<<i<<' '<<i-1<<'\n';
			}
		}else{
			cout<<ans[n].size()<<'\n';
			for(auto [a, b]:ans[n]){
				cout<<a<<' '<<b<<'\n';
			}
		}
	}
}
int main(){
	cin.tie(NULL);
	ios_base::sync_with_stdio(false);
	solve();
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the given buggy code, we need to focus on edge cases and scenarios where the string manipulation and integer calculations might differ significantly. The key points to consider are:

1. **Small values of \( n \) that can quickly lead to long strings when concatenated.**
2. **Values of \( a \) and \( b \) that make the string manipulation and integer subtraction results different.**
3. **Values of \( a \) and \( b \) that are close to the upper limits to maximize the length of the string.**

Given the constraints:
- \( 1 \le n \le 100 \)
- \( 1 \le a \le 10000 \)
- \( 1 \le b \le \min(10000, a \cdot n) \)

We can choose \( n = 2 \) and test with values of \( a \) and \( b \) that are likely to cause issues. Specifically, we can use \( a = 10000 \) and \( b = 19998 \) because:

- \( n \cdot a = 2 \cdot 10000 = 20000 \)
- \( 20000 - 19998 = 2 \)
- The string representation of \( 2 \cdot 10000 \) is "2" repeated 10000 times, which is "2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
from collections import *
from copy import *
import sys

def in_ipynb():
    try:
        cfg = get_ipython().config
        #print(cfg)
        if cfg['IPKernelApp']['parent_appname']:
            return True
        else:
            return False
    except NameError:
        return False
in_prac=(in_ipynb())
fastio=0
if in_prac:
    handle=open('cfinput.txt','r')
def input():
    if in_prac:
        return handle.readline().rstrip('\r').rstrip('\n')
    else:
        return sys.stdin.readline().rstrip('\r').rstrip('\n')
def pr(output): #rename to print for fastio
    sys.stdout.write(str(output)+'\n')
    return
if in_prac:
    handle=open('cfinput.txt','r')
#start here
#10a-b = 10101
#2*a-5 = b
for _ in range(int(input())):
    n=int(input())
    sols=[]
    s=str(n)
    T=len(s)
    for lens in range(1,70):
        cs=''
        ct=0
        poi=0
        while ct<lens:
            cs+=s[poi]
            poi+=1
            ct+=1
            poi%=len(s)
        #print(lens,cs)
        r=int(cs)
        #n*a-b = r
        #2*a-lens = b
        #2*a-b = lens
        #(n-2)*a = r-lens
        #
        F=(r-lens)
        if F%(n-T): continue
        av = F//(n-T)
        bv = n*av-r
        if av<=0 or bv<=0: continue
        if av>10000 or bv>=min(av*n,10000): continue
        sols.append((av,bv))
        assert(av*n-bv == r)
        assert(T*av-bv==lens)
    print(len(sols))
    for i in sols:
        print(*i)

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the buggy code, we need to consider edge cases and scenarios where the string manipulation and integer arithmetic might diverge. Specifically, we need to focus on values of \( n \) that, when multiplied by \( a \), produce a string that, when \( b \) characters are removed, still results in a correct integer value.

Here are the steps to generate a small-scale test input:

1. **Edge Cases for \( n \)**: Consider small values of \( n \) (e.g., 1, 2, 3) and large values (e.g., 98, 99, 100).
2. **Special Values for \( a \)**: Choose values of \( a \) that produce strings with repetitive patterns or that are close to the upper limit (10000).
3. **Special Values for \( b \)**: Choose values of \( b \) that are close to the length of the resulting string or that are exactly the length of the string.

Given these considerations, let's generate a test input with a few test cases:

```plaintext
5
1
2
99
100
50
```

This test input includes:
- \( n = 1 \): The smallest possible value.
- \( n = 2 \): A small value that can produce repetitive strings.
- \( n = 99 \): A large value close to the upper limit.
- \( n = 100 \): The largest possible value.
- \( n = 50 \): A medium value to check for general behavior.

These values should help expose the bug in the buggy code by testing different lengths and patterns of the resulting strings.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
import os
import sys
import math
import random
import threading
from copy import deepcopy
from io import BytesIO, IOBase
from types import GeneratorType
from functools import lru_cache, reduce
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from itertools import accumulate, combinations, permutations
from heapq import nsmallest, nlargest, heapify, heappop, heappush
from typing import Generic, Iterable, Iterator, TypeVar, Union, List
from fractions import Fraction

def debug(func):
    def wrapper(*args, **kwargs):
        print('----------------')
        res = func(*args, **kwargs)
        print('----------------')
        return res

    return wrapper

def bootstrap(f, stack=[]):
    def wrappedfunc(*args, **kwargs):
        if stack:
            return f(*args, **kwargs)
        else:
            to = f(*args, **kwargs)
            while True:
                if type(to) is GeneratorType:
                    stack.append(to)
                    to = next(to)
                else:
                    stack.pop()
                    if not stack:
                        break
                    to = stack[-1].send(to)
            return to

    return wrappedfunc

class SegTree:
    '''
    支持增量更新，覆盖更新，序列更新，任意RMQ操作
    基于二叉树实现
    初始化：O(1)
    增量更新或覆盖更新的单次操作复杂度：O(log k)
    序列更新的单次复杂度：O(n)
    '''

    def __init__(self, f1, f2, l, r, v=0):
        '''
        初始化线段树[left,right)
        f1,f2示例：
        线段和:
        f1=lambda a,b:a+b
        f2=lambda a,n:a*n
        线段最大值:
        f1=lambda a,b:max(a,b)
        f2=lambda a,n:a
        线段最小值:
        f1=lambda a,b:min(a,b)
        f2=lambda a,n:a
        '''
        self.ans = f2(v, r - l)
        self.f1 = f1
        self.f2 = f2
        self.l = l  # left
        self.r = r  # right
        self.v = v  # init value
        self.lazy_tag = 0  # Lazy tag
        self.left = None  # SubTree(left,bottom)
        self.right = None  # SubTree(right,bottom)

    @property
    def mid_h(self):
        return (self.l + self.r) // 2

    def create_subtrees(self):
        midh = self.mid_h
        if not self.left and midh > self.l:
            self.left = SegTree(self.f1, self.f2, self.l, midh)
        if not self.right:
            self.right = SegTree(self.f1, self.f2, midh, self.r)

    def init_seg(self, M):
        '''
        将线段树的值初始化为矩阵Matrx
        输入保证Matrx与线段大小一致
        '''
        m0 = M[0]
        self.lazy_tag = 0
        for a in M:
            if a != m0:
                break
        else:
            self.v = m0
            self.ans = self.f2(m0, len(M))
            return self.ans
        self.v = '#'
        midh = self.mid_h
        self.create_subtrees()
        self.ans = self.f1(self.left.init_seg(M[:midh - self.l]), self.right.init_seg(M[midh - self.l:]))
        return self.ans

    def cover_seg(self, l, r, v):
        '''
        将线段[left,right)覆盖为val
        '''
        if self.v == v or l >= self.r or r <= self.l:
            return self.ans
        if l <= self.l and r >= self.r:
            self.v = v
            self.lazy_tag = 0
            self.ans = self.f2(v, self.r - self.l)
            return self.ans
        self.create_subtrees()
        if self.v != '#':
            if self.left:
                self.left.v = self.v
                self.left.ans = self.f2(self.v, self.left.r - self.left.l)
            if self.right:
                self.right.v = self.v
                self.right.ans = self.f2(self.v, self.right.r - self.right.l)
            self.v = '#'
        # push up
        self.ans = self.f1(self.left.cover_seg(l, r, v), self.right.cover_seg(l, r, v))
        return self.ans

    def inc_seg(self, l, r, v):
        '''
        将线段[left,right)增加val
        '''
        if v == 0 or l >= self.r or r <= self.l:
            return self.ans
        # self.ans = '?'
        if l <= self.l and r >= self.r:
            if self.v == '#':
                self.lazy_tag += v
            else:
                self.v += v
            self.ans += self.f2(v, self.r - self.l)
            return self.ans
        self.create_subtrees()
        if self.v != '#':
            self.left.v = self.v
            self.left.ans = self.f2(self.v, self.left.r - self.left.l)
            self.right.v = self.v
            self.right.ans = self.f2(self.v, self.right.r - self.right.l)
            self.v = '#'
        self.pushdown()
        self.ans = self.f1(self.left.inc_seg(l, r, v), self.right.inc_seg(l, r, v))
        return self.ans

    def inc_idx(self, idx, v):
        '''
        increase idx by val
        '''
        if v == 0 or idx >= self.r or idx < self.l:
            return self.ans
        if idx == self.l == self.r - 1:
            self.v += v
            self.ans += self.f2(v, 1)
            return self.ans
        self.create_subtrees()
        if self.v != '#':
            self.left.v = self.v
            self.left.ans = self.f2(self.v, self.left.r - self.left.l)
            self.right.v = self.v
            self.right.ans = self.f2(self.v, self.right.r - self.right.l)
            self.v = '#'
        self.pushdown()
        self.ans = self.f1(self.left.inc_idx(idx, v), self.right.inc_idx(idx, v))
        return self.ans

    def pushdown(self):
        if self.lazy_tag != 0:
            if self.left:
                if self.left.v != '#':
                    self.left.v += self.lazy_tag
                    self.left.lazy_tag = 0
                else:
                    self.left.lazy_tag += self.lazy_tag
                self.left.ans += self.f2(self.lazy_tag, self.left.r - self.left.l)
            if self.right:
                if self.right.v != '#':
                    self.right.v += self.lazy_tag
                    self.right.lazy_tag = 0
                else:
                    self.right.lazy_tag += self.lazy_tag
                self.right.ans += self.f2(self.lazy_tag, self.right.r - self.right.l)
            self.lazy_tag = 0

    def query(self, l, r):
        '''
        查询线段[right,bottom)的RMQ
        '''
        if l >= r: return 0
        if l <= self.l and r >= self.r:
            return self.ans
        if self.v != '#':
            return self.f2(self.v, min(self.r, r) - max(self.l, l))
        midh = self.mid_h
        anss = []
        if l < midh:
            anss.append(self.left.query(l, r))
        if r > midh:
            anss.append(self.right.query(l, r))
        return reduce(self.f1, anss)

class SortedList:
    def __init__(self, iterable=[], _load=200):
        """Initialize sorted list instance."""
        values = sorted(iterable)
        self._len = _len = len(values)
        self._load = _load
        self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
        self._list_lens = [len(_list) for _list in _lists]
        self._mins = [_list[0] for _list in _lists]
        self._fen_tree = []
        self._rebuild = True

    def _fen_build(self):
        """Build a fenwick tree instance."""
        self._fen_tree[:] = self._list_lens
        _fen_tree = self._fen_tree
        for i in range(len(_fen_tree)):
            if i | i + 1 < len(_fen_tree):
                _fen_tree[i | i + 1] += _fen_tree[i]
        self._rebuild = False

    def _fen_update(self, index, value):
        """Update `fen_tree[index] += value`."""
        if not self._rebuild:
            _fen_tree = self._fen_tree
            while index < len(_fen_tree):
                _fen_tree[index] += value
                index |= index + 1

    def _fen_query(self, end):
        """Return `sum(_fen_tree[:end])`."""
        if self._rebuild:
            self._fen_build()

        _fen_tree = self._fen_tree
        x = 0
        while end:
            x += _fen_tree[end - 1]
            end &= end - 1
        return x

    def _fen_findkth(self, k):
        """Return a pair of (the largest `idx` such that `sum(_fen_tree[:idx]) <= k`, `k - sum(_fen_tree[:idx])`)."""
        _list_lens = self._list_lens
        if k < _list_lens[0]:
            return 0, k
        if k >= self._len - _list_lens[-1]:
            return len(_list_lens) - 1, k + _list_lens[-1] - self._len
        if self._rebuild:
            self._fen_build()

        _fen_tree = self._fen_tree
        idx = -1
        for d in reversed(range(len(_fen_tree).bit_length())):
            right_idx = idx + (1 << d)
            if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
                idx = right_idx
                k -= _fen_tree[idx]
        return idx + 1, k

    def _delete(self, pos, idx):
        """Delete value at the given `(pos, idx)`."""
        _lists = self._lists
        _mins = self._mins
        _list_lens = self._list_lens

        self._len -= 1
        self._fen_update(pos, -1)
        del _lists[pos][idx]
        _list_lens[pos] -= 1

        if _list_lens[pos]:
            _mins[pos] = _lists[pos][0]
        else:
            del _lists[pos]
            del _list_lens[pos]
            del _mins[pos]
            self._rebuild = True

    def _loc_left(self, value):
        """Return an index pair that corresponds to the first position of `value` in the sorted list."""
        if not self._len:
            return 0, 0

        _lists = self._lists
        _mins = self._mins

        lo, pos = -1, len(_lists) - 1
        while lo + 1 < pos:
            mi = (lo + pos) >> 1
            if value <= _mins[mi]:
                pos = mi
            else:
                lo = mi

        if pos and value <= _lists[pos - 1][-1]:
            pos -= 1

        _list = _lists[pos]
        lo, idx = -1, len(_list)
        while lo + 1 < idx:
            mi = (lo + idx) >> 1
            if value <= _list[mi]:
                idx = mi
            else:
                lo = mi

        return pos, idx

    def _loc_right(self, value):
        """Return an index pair that corresponds to the last position of `value` in the sorted list."""
        if not self._len:
            return 0, 0

        _lists = self._lists
        _mins = self._mins

        pos, hi = 0, len(_lists)
        while pos + 1 < hi:
            mi = (pos + hi) >> 1
            if value < _mins[mi]:
                hi = mi
            else:
                pos = mi

        _list = _lists[pos]
        lo, idx = -1, len(_list)
        while lo + 1 < idx:
            mi = (lo + idx) >> 1
            if value < _list[mi]:
                idx = mi
            else:
                lo = mi

        return pos, idx

    def add(self, value):
        """Add `value` to sorted list."""
        _load = self._load
        _lists = self._lists
        _mins = self._mins
        _list_lens = self._list_lens

        self._len += 1
        if _lists:
            pos, idx = self._loc_right(value)
            self._fen_update(pos, 1)
            _list = _lists[pos]
            _list.insert(idx, value)
            _list_lens[pos] += 1
            _mins[pos] = _list[0]
            if _load + _load < len(_list):
                _lists.insert(pos + 1, _list[_load:])
                _list_lens.insert(pos + 1, len(_list) - _load)
                _mins.insert(pos + 1, _list[_load])
                _list_lens[pos] = _load
                del _list[_load:]
                self._rebuild = True
        else:
            _lists.append([value])
            _mins.append(value)
            _list_lens.append(1)
            self._rebuild = True

    def discard(self, value):
        """Remove `value` from sorted list if it is a member."""
        _lists = self._lists
        if _lists:
            pos, idx = self._loc_right(value)
            if idx and _lists[pos][idx - 1] == value:
                self._delete(pos, idx - 1)

    def remove(self, value):
        """Remove `value` from sorted list; `value` must be a member."""
        _len = self._len
        self.discard(value)
        if _len == self._len:
            raise ValueError('{0!r} not in list'.format(value))

    def pop(self, index=-1):
        """Remove and return value at `index` in sorted list."""
        pos, idx = self._fen_findkth(self._len + index if index < 0 else index)
        value = self._lists[pos][idx]
        self._delete(pos, idx)
        return value

    def bisect_left(self, value):
        """Return the first index to insert `value` in the sorted list."""
        pos, idx = self._loc_left(value)
        return self._fen_query(pos) + idx

    def bisect_right(self, value):
        """Return the last index to insert `value` in the sorted list."""
        pos, idx = self._loc_right(value)
        return self._fen_query(pos) + idx

    def count(self, value):
        """Return number of occurrences of `value` in the sorted list."""
        return self.bisect_right(value) - self.bisect_left(value)

    def __len__(self):
        """Return the size of the sorted list."""
        return self._len

    def __getitem__(self, index):
        """Lookup value at `index` in sorted list."""
        pos, idx = self._fen_findkth(self._len + index if index < 0 else index)
        return self._lists[pos][idx]

    def __delitem__(self, index):
        """Remove value at `index` from sorted list."""
        pos, idx = self._fen_findkth(self._len + index if index < 0 else index)
        self._delete(pos, idx)

    def __contains__(self, value):
        """Return true if `value` is an element of the sorted list."""
        _lists = self._lists
        if _lists:
            pos, idx = self._loc_left(value)
            return idx < len(_lists[pos]) and _lists[pos][idx] == value
        return False

    def __iter__(self):
        """Return an iterator over the sorted list."""
        return (value for _list in self._lists for value in _list)

    def __reversed__(self):
        """Return a reverse iterator over the sorted list."""
        return (value for _list in reversed(self._lists) for value in reversed(_list))

    def __repr__(self):
        """Return string representation of sorted list."""
        return 'SortedList({0})'.format(list(self))

T = TypeVar('T')
class SortedSet(Generic[T]):
    BUCKET_RATIO = 50
    REBUILD_RATIO = 170

    def _build(self, a=None) -> None:
        "Evenly divide `a` into buckets."
        if a is None: a = list(self)
        size = self.size = len(a)
        bucket_size = int(math.ceil(math.sqrt(size / self.BUCKET_RATIO)))
        self.a = [a[size * i // bucket_size: size * (i + 1) // bucket_size] for i in range(bucket_size)]

    def __init__(self, a: Iterable[T] = []) -> None:
        "Make a new SortedSet from iterable. / O(N) if sorted and unique / O(N log N)"
        a = list(a)
        if not all(a[i] < a[i + 1] for i in range(len(a) - 1)):
            a = sorted(set(a))
        self._build(a)

    def __iter__(self) -> Iterator[T]:
        for i in self.a:
            for j in i: yield j

    def __reversed__(self) -> Iterator[T]:
        for i in reversed(self.a):
            for j in reversed(i): yield j

    def __len__(self) -> int:
        return self.size

    def __repr__(self) -> str:
        return "SortedSet" + str(self.a)

    def __str__(self) -> str:
        s = str(list(self))
        return "{" + s[1: len(s) - 1] + "}"

    def _find_bucket(self, x: T) -> List[T]:
        "Find the bucket which should contain x. self must not be empty."
        for a in self.a:
            if x <= a[-1]: return a
        return a

    def __contains__(self, x: T) -> bool:
        if self.size == 0: return False
        a = self._find_bucket(x)
        i = bisect_left(a, x)
        return i != len(a) and a[i] == x

    def add(self, x: T) -> bool:
        "Add an element and return True if added. / O(√N)"
        if self.size == 0:
            self.a = [[x]]
            self.size = 1
            return True
        a = self._find_bucket(x)
        i = bisect_left(a, x)
        if i != len(a) and a[i] == x: return False
        a.insert(i, x)
        self.size += 1
        if len(a) > len(self.a) * self.REBUILD_RATIO:
            self._build()
        return True

    def discard(self, x: T) -> bool:
        "Remove an element and return True if removed. / O(√N)"
        if self.size == 0: return False
        a = self._find_bucket(x)
        i = bisect_left(a, x)
        if i == len(a) or a[i] != x: return False
        a.pop(i)
        self.size -= 1
        if len(a) == 0: self._build()
        return True

    def lt(self, x: T) -> Union[T, None]:
        "Find the largest element < x, or None if it doesn't exist."
        for a in reversed(self.a):
            if a[0] < x:
                return a[bisect_left(a, x) - 1]

    def le(self, x: T) -> Union[T, None]:
        "Find the largest element <= x, or None if it doesn't exist."
        for a in reversed(self.a):
            if a[0] <= x:
                return a[bisect_right(a, x) - 1]

    def gt(self, x: T) -> Union[T, None]:
        "Find the smallest element > x, or None if it doesn't exist."
        for a in self.a:
            if a[-1] > x:
                return a[bisect_right(a, x)]

    def ge(self, x: T) -> Union[T, None]:
        "Find the smallest element >= x, or None if it doesn't exist."
        for a in self.a:
            if a[-1] >= x:
                return a[bisect_left(a, x)]

    def __getitem__(self, x: int) -> T:
        "Return the x-th element, or IndexError if it doesn't exist."
        if x < 0: x += self.size
        if x < 0: raise IndexError
        for a in self.a:
            if x < len(a): return a[x]
            x -= len(a)
        raise IndexError

    def index(self, x: T) -> int:
        "Count the number of elements < x."
        ans = 0
        for a in self.a:
            if a[-1] >= x:
                return ans + bisect_left(a, x)
            ans += len(a)
        return ans

    def index_right(self, x: T) -> int:
        "Count the number of elements <= x."
        ans = 0
        for a in self.a:
            if a[-1] > x:
                return ans + bisect_right(a, x)
            ans += len(a)
        return ans

BUFSIZE = 4096
class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

class PrimeTable:
    def __init__(self, n:int) -> None:
        self.n = n
        self.primes = [] # 小于等于n的所有质数
        self.min_div = [0] * (n+1)
        self.min_div[1] = 1

        mu = [0] * (n+1)
        phi = [0] * (n+1)
        mu[1] = 1
        phi[1] = 1

        for i in range(2, n+1):
            if not self.min_div[i]:
                self.primes.append(i)
                self.min_div[i] = i
                mu[i] = -1
                phi[i] = i-1
            for p in self.primes:
                if i * p > n: break
                self.min_div[i*p] = p
                if i % p == 0:
                    phi[i*p] = phi[i] * p
                    break
                else:
                    mu[i*p] = -mu[i]
                    phi[i*p] = phi[i] * (p - 1)

    # x是否质数
    def is_prime(self, x:int):
        if x < 2: return False
        if x <= self.n: return self.min_div[x] == x
        for i in range(2, int(math.sqrt(x))+1):
            if x % i == 0: return False
        return True

    # x分解质因数:[p, cnt]
    def prime_factorization(self, x:int):
        for p in range(2, int(math.sqrt(x))+1):
            if x <= self.n: break
            if x % p == 0:
                cnt = 0
                while x % p == 0: cnt += 1; x //= p
                yield p, cnt
        while (1 < x and x <= self.n):
            p, cnt = self.min_div[x], 0
            while x % p == 0: cnt += 1; x //= p
            yield p, cnt
        if x >= self.n and x > 1:
            yield x, 1

    # x的所有因数
    def get_factors(self, x:int):
        factors = [1]
        for p, b in self.prime_factorization(x):
            n = len(factors)
            for j in range(1, b+1):
                for d in factors[:n]:
                    factors.append(d * (p ** j))
        return factors

sys.stdin = IOWrapper(sys.stdin)
sys.stdout = IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

def I():
    return input()

def II():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(input().split())

def LII():
    return list(map(int, input().split()))

def GMI():
    return map(lambda x: int(x) - 1, input().split())

def LGMI():
    return list(map(lambda x: int(x) - 1, input().split()))

def solve():
    n = II()
    if n == 1:
        print(10000)
        for b in range(1,10000-1):
            print(*[b+1,b])
    else:
        d = len(str(n))
        ans = []
        for i in range(d):
            k = i
            while True:
                div,res = divmod(d*(10**i*(10**(k-i)-1)*n//(10**d-1)+n//10**(d-i))-n*k,n-d)
                if div < 10001:
                    if not res and div > 0 and div%d == i:
                        ans.append((((10**i*(10**(k-i)-1)*n//(10**d-1)+n//10**(d-i))-k)//(n-d),div))
                else:
                    break
                k += d
        print(len(ans))
        for c in ans:
            print(*c)

if __name__ == '__main__':
    for _ in range(II()):
        solve()

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided buggy code, we need to focus on edge cases and scenarios where the string manipulation in the buggy code would differ significantly from the correct integer arithmetic. Here are the steps to consider:

1. **Edge Cases for `n`**:
   - `n = 1`: This is a special case where the string manipulation might not differ significantly from the integer arithmetic.
   - `n = 10`: This is a case where the string representation can lead to significant differences due to the way string multiplication and subtraction work.
   - `n = 99`: This is a large value of `n` that can also cause significant differences.

2. **Edge Cases for `a` and `b`**:
   - `a = 1`: This is the smallest possible value for `a`.
   - `a = 10000`: This is the largest possible value for `a`.
   - `b = 1`: This is the smallest possible value for `b`.
   - `b = n * a`: This is the largest possible value for `b`.

3. **Combining Edge Cases**:
   - For `n = 1`, `a = 1`, `b = 1` should give the correct answer.
   - For `n = 10`, `a = 10000`, `b = 99990` should give the correct answer.
   - For `n = 99`, `a = 10000`, `b = 989999` should give the correct answer.

4. **Test Input**:
   - We will create a test input with three test cases: `n = 1`, `n = 10`, and `n = 99`.

Here is the test input:

```plaintext
3
1
10
99
```

This test input is small-scale and complete, ensuring that it covers a range of edge cases for `n` to maximize the failure probability in the faulty solution.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Novice's Mistake
time_limit_ms: 3000
memory_limit_mb: 256
Description: One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 \le n \le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 \le a \le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 \le b \le \min(10000, a \cdot n))$$$ apples to his friends. How many apples are left with Noobish_Monk?"

K1o0n wrote a solution, but accidentally considered the value of $$$n$$$ as a string, so the value of $$$n \cdot a - b$$$ was calculated differently. Specifically:

- when multiplying the string $$$n$$$ by the integer $$$a$$$, he will get the string $$$s=\underbrace{n + n + \dots + n + n}_{a\ \text{times}}$$$
- when subtracting the integer $$$b$$$ from the string $$$s$$$, the last $$$b$$$ characters will be removed from it. If $$$b$$$ is greater than or equal to the length of the string $$$s$$$, it will become empty.

Learning about this, ErnKor became interested in how many pairs $$$(a, b)$$$ exist for a given $$$n$$$, satisfying the constraints of the problem, on which K1o0n's solution gives the correct answer.

"The solution gives the correct answer" means that it outputs a non-empty string, and this string, when converted to an integer, equals the correct answer, i.e., the value of $$$n \cdot a - b$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$)  — the number of test cases.

For each test case, a single line of input contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).

It is guaranteed that in all test cases, $$$n$$$ is distinct.

Output: For each test case, output the answer in the following format:

In the first line, output the integer $$$x$$$ — the number of bad tests for the given $$$n$$$.

In the next $$$x$$$ lines, output two integers $$$a_i$$$ and $$$b_i$$$ — such integers that K1o0n's solution on the test "$$$n$$$ $$$a_i$$$ $$$b_i$$$" gives the correct answer.

Examples:
input:
3
2
3
10
output:
3
20 18
219 216
2218 2214
1
165 162
1
1262 2519

Note: In the first example, $$$a = 20$$$, $$$b = 18$$$ are suitable, as "$$$\text{2}$$$" $$$\cdot 20 - 18 =$$$ "$$$\text{22222222222222222222}$$$"$$$- 18 = 22 = 2 \cdot 20 - 18$$$

Buggy Code:
// Source: https://usaco.guide/general/io

import java.io.*;
import java.util.*;

// Source: https://usaco.guide/general/io

import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		int T = sc.nextInt();

		while(T-- > 0){
			List<String> sols = new ArrayList<String>();
			int N = sc.nextInt();
			// Brute force
			// The string can have length at most 8
			int L = Integer.toString(N).length();
			if(N == 1){
				System.out.println(0);
				continue;
			}
			for(int endLength = 1; endLength < 8; endLength++){
				int endNum = Integer.parseInt(Integer.toString(N).repeat(endLength/L) + Integer.toString(N).substring(0,endLength%L));

				//(N - L) * A + endLength = endNum
				//sols.add(N + " " + L + " " + endLength + " " + endNum);
				if((endNum - endLength)%(N - L) == 0){
					int A = (endNum - endLength)/(N - L);
					if(1 <= A && A <= 10000 && (1 <= L * A - endLength && L * A - endLength <= 10000)){
						//System.out.println(A + " " + (L * A - endLength));
						sols.add(A + " " + (L * A - endLength));
					}
				}
			}
			System.out.println(sols.size());
			for(String sol : sols){
				System.out.println(sol);
			}

		}

	}
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1
99
100
```