**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: The Strict Teacher (Easy Version)
time_limit_ms: 1500
memory_limit_mb: 256
Description: This is the easy version of the problem. The only differences between the two versions are the constraints on $m$ and $q$. In this version, $m=2$ and $q=1$. You can make hacks only if both versions of the problem are solved.

Narek and Tsovak were busy preparing this round, so they have not managed to do their homework and decided to steal David's homework. Their strict teacher noticed that David has no homework and now wants to punish him. She hires other teachers to help her catch David. And now $m$ teachers together are chasing him. Luckily, the classroom is big, so David has many places to hide.

The classroom can be represented as a one-dimensional line with cells from $1$ to $n$, inclusive.

At the start, all $m$ teachers and David are in distinct cells. Then they make moves. During each move

  * David goes to an adjacent cell or stays at the current one.    * Then, each of the $m$ teachers simultaneously goes to an adjacent cell or stays at the current one.

This continues until David is caught. David is caught if any of the teachers (possibly more than one) is located in the same cell as David. Everyone sees others' moves, so they all act optimally.

Your task is to find how many moves it will take for the teachers to catch David if they all act optimally.

Acting optimally means the student makes his moves in a way that maximizes the number of moves the teachers need to catch him; and the teachers coordinate with each other to make their moves in a way that minimizes the number of moves they need to catch the student.

Also, as Narek and Tsovak think this task is easy, they decided to give you $q$ queries on David's position. Note: this is the easy version, and you are given only one query.

Input: In the first line of the input, you are given a single integer $t$ ($1 \le t \le 10^5$) — the number of test cases. The description of each test case follows.

In the first line of each test case, you are given three integers $n$, $m$, and $q$ ($3 \le n \le 10^9$, $m=2$, $q=1$) — the number of cells on the line, the number of teachers, and the number of queries.

In the second line of each test case, you are given $m$ distinct integers $b_1, b_2, \ldots, b_m$ ($1 \le b_i \le n$) — the cell numbers of the teachers.

In the third line of each test case, you are given $q$ integers $a_1, a_2, \ldots, a_q$ ($1 \le a_i \le n$) — David's cell number for every query.

It is guaranteed that for any $i$, $j$ such that $1 \le i \le m$ and $1 \le j \le q$, $b_i \neq a_j$.

Output: For each test case, output $q$ lines, the $i$-th of them containing the answer of the $i$-th query.

Examples:
input:
3
10 2 1
1 4
2
8 2 1
3 6
1
8 2 1
3 6
8
output:
1
2
2

Note: In the first example, the student can just stay at cell $2$. The teacher, initially located in cell $1$, can reach cell $2$ in one move. Therefore, the answer is $1$.

In the second example, the student should just stay at cell $1$. The teacher, initially located in cell $3$, can reach cell $1$ in two moves. Therefore, the answer is $2$.

Buggy Code:
import java.util.Scanner;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int testCases = scanner.nextInt();
        while (testCases-- > 0) {
            ProblemSolver solver = new ProblemSolver(scanner);
            System.out.println(solver.calculateMinimumDistance());
        }

        scanner.close();
    }
}

class ProblemSolver {
    private long[] timeValues;
    private long targetValue;

    public ProblemSolver(Scanner scanner) {
        int numberOfTimes = scanner.nextInt();
        int numberOfDistances = scanner.nextInt();
        int queries = scanner.nextInt();  // This variable is not used in the current context

        timeValues = new long[numberOfDistances];
        for (int i = 0; i < numberOfDistances; i++) {
            timeValues[i] = scanner.nextLong();
        }

        targetValue = scanner.nextLong();
    }

    public long calculateMinimumDistance() {
        long minimumDistance = Long.MAX_VALUE;

        for (long time : timeValues) {
            minimumDistance = Math.min(minimumDistance, Math.abs(time - targetValue));
        }

        return minimumDistance;
    }
}

**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
10 2 1
1 10
2
10 2 1
1 10
5
10 2 1
1 10
9
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
#include<bits/stdc++.h>
using namespace std;

#define pb push_back
#define ff first
#define ss second

#define int long long
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vii;

const int M = 1e9+7;
const int N = 2e5+10;
int n,k;
vi a;
bool can (int mid){
    int deck_size = mid;
    deck_size--;
    // consider 1 to n-1
    // no of decks = a[n];
    int decks = a[n];
    int sum=0;
    for(int i=n-1;i>=1;i--){
        sum += a[i];
        if(sum>=decks){
            deck_size--;
            sum = sum-decks;
        }
    }
    if(deck_size<=0 && sum==0) return true;
    else {
        if(sum + k >= mid && deck_size - (sum+k)/decks <= 0) return true;
        else{
            return false;
        }
    }
}
void solve(){
   cin>>n;
   cin>>k;
  a.resize(n+1,0);
  for(int i=1;i<=n;i++) cin>>a[i];
  sort(a.begin()+1,a.end());

  int l=1,r=n;
  int ans = 1;
  while(l<=r){
      int mid = l+r >>1;
      if(can(mid)){
          l=mid+1;
          ans = mid;
      }
      else{
          r=mid-1;
          }
  }

  cout<<ans<<endl;

}

int32_t 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 given code, we need to consider the following:

1. **Edge Cases**: Cases where the number of cards is minimal or maximal.
2. **Large Values**: Cases where the number of coins or the number of cards of a particular type is very large.
3. **Specific Patterns**: Cases where the distribution of card types is such that the algorithm's logic might fail.

The buggy code has a logical flaw in the `can` function, particularly in how it handles the remaining cards and coins. Let's create a test case that emphasizes this issue.

### Test Case Analysis
- **Small Number of Card Types**: This can help in understanding how the algorithm handles minimal inputs.
- **Large Number of Coins**: This can help in understanding how the algorithm handles a large budget for buying cards.
- **Uneven Distribution of Cards**: This can help in understanding how the algorithm handles cases where some card types are much more frequent than others.

### Challenging Test Input
```plaintext
3
3 1
3 2 2
5 4
2 6 1 2 4
2 10
1 10000000000
```

### Explanation
1. **Test Case 1**:
   - **n = 3, k = 1**
   - **a = [3, 2, 2]**
   - This case is similar to the example given, where buying one card with the number 1 can increase the deck size to 2.

2. **Test Case 2**:
   - **n = 5, k = 4**
   - **a = [2, 6, 1, 2, 4]**
   - This case involves a larger number of card types and a moderate number of coins. The goal is to see if the algorithm can handle a more complex distribution of cards.

3. **Test Case 3**:
   - **n = 2, k = 10**
   - **a = [1, 10000000000]**
   - This case involves a very large number of cards of one type and a large number of coins. The goal is to see if the algorithm can handle a very large input and correctly determine the maximum deck size.

These test cases are designed to challenge the algorithm by testing its ability to handle small and large inputs, as well as uneven distributions of cards.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define endl cout<<'\n'
#define nl <<'\n'
#define input(x) for(auto& it:x) cin>>it;
#define output(x) for(auto& it:x) cout<<it<<" "; endl;
#define yesno(x) cout<<(x?"YES\n":"NO\n")
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define spc <<" "<<
#define srt(x,n) sort(x,x+n)
#define rsrt(x,n) sort(x,x+n,greater<int>())
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vll(x) vector<x>
#define mll(x,y) map<x,y,>
#define qll(x) queue<x>
#define omll(x,y) unordered_map<x,y,custom_hash>
#define loop(i,j,n) for(ll i=j;i<n;++i)
#define rloop(i,j,n) for(ll i=n-1;i>=j;--i)
#define cloop(i,j,n) for(ll i=j;n;++i)
const int N=1e5+10;
const ll mod=1e9+7;
ll poww(ll,ll);
ll maxx(ll,ll);
ll minn(ll,ll);
vll(ll) GeneratePrime(ll);
void solve(){
    ll n,k;
    cin>>n>>k;
    ll arr[n];
    input(arr);
    srt(arr,n);
    if(k == 0){
        if(arr[0] != arr[n-1]){
            cout<<1;
        }
        else cout<<arr[n-1];
        return;
    }
    ll sum = 0,maxi = *max_element(arr,arr+n);
    loop(i,0,n) sum += arr[i];
    ll temp = k;
    loop(i,0,n){
        if((arr[i] + k) > maxi){
            arr[i] = maxi;
            k -= (maxi - arr[i]);
        }
        else break;
    }
    srt(arr,n);
    if(arr[0] == arr[n]){
        cout<<maxi;
        return;
    }
    cout<<minn(n,(sum+k)/maxi);
}
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr), cout.tie(nullptr);
    auto begin = std::chrono::high_resolution_clock::now();
    ll t = 1;
    cin >> t;
    while(t--){
        solve();
        endl;
    }
    auto end = std::chrono::high_resolution_clock::now();
    auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin);
    cerr << "\nTime Measured: " << elapsed.count() * 1e-9 << " seconds\n";
    return 0;
}
ll poww(ll x,ll p){
    //Base Case
    if(!p) return 1;
    //RR
    ll ans=poww(x,p/2);
    if(p&1) return (ans*ans%mod)*x%mod;
    else return ans*ans%mod;
}
ll maxx(ll x,ll y){
    return (x>y?x:y);
}
ll minn(ll x,ll y){
    return (x<y?x:y);
}
vll(ll) GeneratePrime(ll n){
    vll(ll) isPrime(n,1);
    isPrime[0] = isPrime[1] = 0;
    cloop(i,2,i*i<=n){
        if(isPrime[i]){
            ll j = i*i;  //Prime Number
            while(j<=n){
                isPrime[j] = 0; //Mark Multiple Of Prime
                j+=i;
            }
        }
    }
    return isPrime;
}
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

**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
1
3 1
1 1 2
```

**Explanation:**
- This test case is designed to expose the bug in the buggy code.
- The input consists of 3 types of cards with counts 1, 1, and 2, and 1 coin to buy an additional card.
- The correct output should be 2, because you can buy one card with the number 3, making the total counts [1, 1, 3]. You can then partition the cards into two decks: [1, 3] and [1, 3].
- The buggy code, however, might not handle this case correctly because it incorrectly modifies the array and may not correctly calculate the maximum possible deck size.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
#define int long long
	int t;
	cin >> t;
	while (t--)
	{
		int n, k;
		cin >> n >> k;
		vector<int>amount(n);
		int sum = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> amount[i];
			sum += amount[i];
		}

		sort(amount.begin(), amount.end());
		int minWidth = max(amount[n-1],(long long)2);
		if (sum + k >= n * minWidth)
		{
			cout << n << endl;
			continue;
		}
		int height = sum/minWidth+(sum%minWidth?1:0);
		while ( sum+k<minWidth*(height))
		{
			if (height <= 1)
			{
				break;
			}
			minWidth++;
			height--;
		}
		k -= minWidth * height;

		while (height < n && k>0)
			if (k / minWidth)
			{
				height++;
				k -= minWidth;
			}
			else break;
		cout << height << endl;
	}
}

**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 that can cause the algorithm to fail. The code has several potential issues, such as incorrect handling of the minimum width and the height of the decks. Here are some key considerations:

1. **Large Number of Coins (k):** The code might not handle large values of \( k \) correctly.
2. **Small Number of Cards (n):** The code might not handle small values of \( n \) correctly.
3. **Uneven Distribution of Cards:** The code might not handle cases where the distribution of cards is very uneven.
4. **Sum of Cards Close to the Limit:** The code might not handle cases where the sum of cards plus the number of coins is close to the limit for a specific deck size.

Given these considerations, let's create a small-scale test input that can expose the bug:

1. **Test Case 1:** Small \( n \) and \( k \), with a few cards.
2. **Test Case 2:** Small \( n \) and large \( k \), with a few cards.
3. **Test Case 3:** Large \( n \) and small \( k \), with a few cards.
4. **Test Case 4:** Large \( n \) and large \( k \), with a few cards.

Here is the test input:

```plaintext
4
3 1
3 2 2
2 10
1 1
10 5
1 1 1 1 1 1 1 1 1 1
10 100
1 2 3 4 5 6 7 8 9 10
```

Explanation:
1. **Test Case 1:** \( n = 3 \), \( k = 1 \), cards = [3, 2, 2]. This is a basic case to check the minimum width and height calculation.
2. **Test Case 2:** \( n = 2 \), \( k = 10 \), cards = [1, 1]. This case checks the handling of a large number of coins with a small number of cards.
3. **Test Case 3:** \( n = 10 \), \( k = 5 \), cards = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]. This case checks the handling of a large number of card types with a small number of coins.
4. **Test Case 4:** \( n = 10 \), \( k = 100 \), cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]. This case checks the handling of a large number of card types and a large number of coins.

These test cases should help expose the bug in the given buggy code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
import math

def find_half_factors(n):
    factors=[]
    for i in range(1,math.floor(math.sqrt(n))+1):
        if n % i == 0:
            factors.append(i)
    return factors

for _ in range(int(input())):
    n,k=map(int,input().split())
    a=list(map(int,input().split()))
    if _ == 103:
        print(a[-1]*2)
    maxi=max(a)
    sumi=sum(a)

    av = n * maxi - sumi
    if k >=av:
        print(n)
        continue

    #k < available -> not enough k to fill board
    if sumi % maxi == 0:
        print((sumi + k)//n)
    elif (maxi - (sumi % maxi)) <= k:
        print((sumi + k)//n)
    else: #have to change maxi
        ans=None
        for i in range(1,k+1):
            if ((sumi +i) % (maxi + i)) <= k - i:
                ans=(sumi + k)//(maxi+i)
                break
        if ans==None:
            print(1)
        else:
            print(ans)

**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
1
10 5
1 2 3 4 5 6 7 8 9 10
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
t = int(input())
for _ in range(t):
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()
    sa = sum(a)
    if n*n > sa and k >= n*n - sa:
        print(n)
    else:
        minset = a[-1]
        valused = 0
        while True:
            rem = sa % minset
            div = sa // minset
            if rem == 0:
                break
            if (rem + k) // minset > 0:
                valused = minset - rem
                break
            if div == 1:
                break
            minset += 1

        print((valused+sa)//minset)

**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
1
5 10
1 2 3 4 5
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
from math import inf
from collections import *
import math, os, sys, heapq, bisect, random,threading
from functools import *
from itertools import *
def inp(): return sys.stdin.readline().rstrip("\r\n")
def out(var): sys.stdout.write(str(var))  # for fast output, always take string
def inpu(): return int(inp())
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
def fsep(): return map(float, inp().split())
M,M1,Y,N=1000000007,998244353,"Yes","No"

def calculate(p, q, mod):
    expo = mod - 2
    while (expo):
        if (expo & 1):
            p = (p * q) % mod
        q = (q * q) % mod
        expo >>= 1
    return p

def main():
    how_much_noob_I_am = 1
    how_much_noob_I_am = inpu()
    for _ in range(how_much_noob_I_am):
        n,k = sep()
        arr = lis()
        # print((sum(arr)+min(max(arr),k))//max(arr))
        max1 = max(arr)
        max2 = max1
        s = sum(arr)
        while (max1 * n - s <= k and max1<n):
            max1+=1
        k-=(max1-max2)
        for i in range(n):
                if arr[i]<max1:
                    diff = max1 - arr[i]
                    if diff>k:
                        s+=k
                        break
                    else:
                        s+=diff
                        k-=diff
        print(min(s//max1,s//n,n))

if __name__ == '__main__':
    # sys.setrecursionlimit(5*(10**5)+50)
    # threading.stack_size(10**8)
    # threading.Thread(target=main).start()
    main()

**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 consider the following aspects:

1. **Edge Cases**: Test cases where the number of cards is very small or very large, or where the number of coins is very large.
2. **Corner Cases**: Test cases where the distribution of cards is highly skewed, or where the number of coins is just enough to make a significant difference.
3. **Boundary Conditions**: Test cases where the maximum deck size is close to the number of card types or where the sum of cards is close to the maximum possible sum.

Let's construct a test case that can expose the bug in the code:

### Test Case Analysis
- **Small Number of Card Types (n) and Coins (k)**: This can help us focus on the logic of the algorithm.
- **Highly Skewed Distribution of Cards**: This can test how the algorithm handles cases where some card types are much more frequent than others.
- **Coins Just Enough to Make a Difference**: This can test the algorithm's ability to handle cases where the number of coins is just enough to increase the deck size.

### Chosen Test Case
- **Number of Test Cases (t)**: 1 (to keep it simple and focused)
- **Number of Card Types (n)**: 3
- **Number of Coins (k)**: 2
- **Initial Card Distribution (a_1, a_2, a_3)**: 3, 2, 2

This test case is similar to the first example provided but with a different number of coins. The goal is to see how the algorithm handles the situation where it can buy up to 2 cards.

### Test Input
```plaintext
1
3 2
3 2 2
```

### Explanation
- **Initial Setup**: You have 3 cards of type 1, 2 cards of type 2, and 2 cards of type 3.
- **Coins Available**: 2 coins.
- **Expected Behavior**: The optimal strategy is to buy 2 cards of type 1, making the total cards [5, 2, 2]. You can then partition them into decks of size 2: [1, 2], [1, 2], [1, 3], [1, 3], [1, 3]. The maximum deck size is 2.

This test case should expose any issues in the logic of the algorithm, particularly in how it handles the distribution of cards and the use of coins.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

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

public class three {
	static Scanner sc1 = new Scanner(System.in);
	static PrintWriter out;
	static FastReader sc = new FastReader();
	final static int MOD = 1000000007;

	public static void main(String[] args) throws Exception {
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void solve() {
		int cases=sc.nextInt();
		while(cases-->0)
		{
			int n = sc.nextInt();
			long k = sc.nextInt();
			long[] cards = new long[n];
			long total=0;
			long max =0;
			long numMaxes=0;
			for(int i=0; i<n;i++)
			{
				cards[i] = sc.nextLong();
				total+=cards[i];
				if(cards[i]>max)
				{
					numMaxes=1;
					max=cards[i];
				}
				else if(cards[i]==max)
				{
					numMaxes++;
				}
			}
			k=Math.min(k, n-numMaxes);
//			boolean won=false;
			for(long i=(total+k)/max; i>=1;i--)
			{
				long diff = total - (max * i);
				if((diff <=0 && diff+k>=0))
				{
					System.out.println(i);
//					won=true;
					break;
				}
				else if(diff > 0)
				{
					if((max*i)+k>=total)
					{
						System.out.println(i);
//						won=true;
						break;
					}
					else
					{
						System.out.println(1);
						break;
					}

				}
			}
//			if(!won)
//
		}

	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

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

		String nextLine() {
			String str = "";
			try {
				if (st.hasMoreTokens()) {
					str = st.nextToken("\n");
				} else {
					str = br.readLine();
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}

**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 test input that exposes the bug in the given buggy code, let's analyze the logic and identify potential edge cases or scenarios where the code might fail.

### Analysis of the Buggy Code
1. **Initialization and Input Reading:**
   - The code reads the number of test cases, `n` and `k`, and the number of cards for each type.
   - It calculates the total number of cards and finds the maximum number of cards of any type (`max`).

2. **Key Logic:**
   - The code iterates from `(total + k) / max` down to 1 to find the maximum possible deck size.
   - It calculates the difference between the total number of cards and the product of `max` and the current deck size.
   - It checks if the difference is less than or equal to 0 and if the difference plus `k` is greater than or equal to 0.
   - If the conditions are met, it prints the current deck size and breaks the loop.

### Potential Edge Cases
1. **Single Type of Card:**
   - If there is only one type of card, the code should handle it correctly, but it's a good edge case to test.
2. **Equal Number of Cards for All Types:**
   - If all types have the same number of cards, the code should handle it correctly.
3. **Large Number of Coins:**
   - If `k` is very large, the code should not buy more cards than necessary.
4. **Small Number of Coins:**
   - If `k` is very small, the code should not be able to buy many cards.
5. **Uneven Distribution of Cards:**
   - If the distribution of cards is highly uneven, the code should still find the correct maximum deck size.

### Test Input
Let's create a test input that includes a mix of these edge cases:

```plaintext
5
1 100
100
3 2
1 2 3
4 0
1 2 3 4
2 1
1 1
5 5
1 1 1 1 1
```

### Explanation
1. **Test Case 1:**
   - `n = 1`, `k = 100`, `a = [100]`
   - There is only one type of card, and we have 100 coins. The maximum deck size should be 100.
2. **Test Case 2:**
   - `n = 3`, `k = 2`, `a = [1, 2, 3]`
   - We have 3 types of cards with 1, 2, and 3 cards respectively, and 2 coins. The maximum deck size should be 3.
3. **Test Case 3:**
   - `n = 4`, `k = 0`, `a = [1, 2, 3, 4]`
   - We have 4 types of cards with 1, 2, 3, and 4 cards respectively, and no coins. The maximum deck size should be 1.
4. **Test Case 4:**
   - `n = 2`, `k = 1`, `a = [1, 1]`
   - We have 2 types of cards with 1 card each, and 1 coin. The maximum deck size should be 2.
5. **Test Case 5:**
   - `n = 5`, `k = 5`, `a = [1, 1, 1, 1, 1]`
   - We have 5 types of cards with 1 card each, and 5 coins. The maximum deck size should be 2.

This test input should help identify any issues in the buggy code by covering a variety of scenarios.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.*;

public class Main {
    static final int MOD = 1000000007;
    static final String no = "NO";
    static final String yes = "YES";

    @SuppressWarnings("all")
    static long[] generatePrefix(long a[], int n){
        long[] res = new long[n+1];
        for(int i = 0;i<n;i++){
            res[i+1] = res[i] + a[i];
        }
        return res;
    }

    @SuppressWarnings("all")
    static void reverseArray(long a[],int i,int j){
        while(i<j){
            long t = a[i];
            a[i] = a[j];
            a[j] = t;
            i++;
            j--;
        }
    }

    @SuppressWarnings("all")
    static long factorial(Number n)
    {
        long res = 1, i;
        for (i = 2; i <= (long)n; i++)
            res *= i;
        return res;
    }

    @SuppressWarnings("all")
    static int lower_bound(Long array[], Long key)
    {
        int low = 0, high = array.length;
        int mid;
        while (low < high) {
            mid = low + (high - low) / 2;
            if (key <= array[mid]) {
                high = mid;
            }
            else {

                low = mid + 1;
            }
        }
        if (low < array.length && array[low] < key) {
            low++;
        }
        return low;
    }
    @SuppressWarnings("all")
    static long gcd(long a, long b) {
        if(b == 0)return a;
        return gcd(b, a%b);
    }

    @SuppressWarnings("all")
    static long[] getArray(int n,Scanner sc){
        long res[] = new long[n];
        for(int i =0;i<n;i++){
            res[i] = sc.nextLong();
        }
        return res;
    }

    @SuppressWarnings("all")
    static void printArray(long a[],int i,int j){
        for(int x = i;x<=j;x++){
            System.out.print(a[x] + " ");
        }
        System.out.println();
    }

    @SuppressWarnings("all")
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-->0) {
            int n = sc.nextInt();
            long k = sc.nextLong();
            long a[] = getArray(n,sc);
            long sum = 0;
            long max = 0;
            for(int i  =0;i<n;i++){
                sum+=a[i];
                max = Math.max(a[i],max);
            }
            if(k/n >= 1){
                max += k/n;
                k = k%n;
            }
            long ans = n;
            for(int p = n;p>=1;p--){
                long nsum = sum + (k/p)*p;
                if(nsum % p <= k && max <= (nsum + (nsum%p))/p){
                    ans = p;
                    break;
                }
            }
            System.out.println(ans);
        }

    }

}

**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 code, let's analyze the logic and potential edge cases:

### Analysis of the Code
1. **Input Handling**: The code reads the number of test cases and the details for each test case.
2. **Sum and Max Calculation**: It calculates the total number of cards (`sum`) and the maximum number of cards of any single type (`max`).
3. **Adjusting Max and k**: If `k` is large enough to buy at least one card for each type, it adjusts `max` and reduces `k`.
4. **Finding the Maximum Deck Size**: It iterates from `n` to `1` and checks if the conditions for forming decks of size `p` are met.

### Potential Bugs
- **Incorrect Handling of `k`**: The code might not correctly handle the distribution of `k` when `k` is large.
- **Incorrect Conditions for Deck Formation**: The conditions for forming decks might be overly restrictive or miss some valid scenarios.

### Challenging Test Input
To expose these potential bugs, we can create a test case where:
- The number of cards of each type is not uniform.
- The value of `k` is large enough to significantly change the number of cards but not enough to buy a card for each type.

### Test Case
```plaintext
3
5 10
1 2 3 4 5
5 20
1 2 3 4 5
5 25
1 2 3 4 5
```

### Explanation
1. **Test Case 1**:
   - `n = 5`, `k = 10`
   - Initial cards: `1, 2, 3, 4, 5`
   - The code should be able to buy cards to form decks of size 3 or 4, but it might not handle the large `k` correctly.

2. **Test Case 2**:
   - `n = 5`, `k = 20`
   - Initial cards: `1, 2, 3, 4, 5`
   - The code should be able to buy enough cards to form decks of size 5, but it might not handle the large `k` correctly.

3. **Test Case 3**:
   - `n = 5`, `k = 25`
   - Initial cards: `1, 2, 3, 4, 5`
   - The code should be able to buy enough cards to form decks of size 5, but it might not handle the large `k` correctly.

These test cases are designed to challenge the code's ability to handle large `k` values and to correctly form decks of the maximum possible size.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
# ﷽
# my template (https://github.com/Mohamed-Elnageeb , https://codeforces.com/profile/the_last_smilodon) :
import sys
from heapq import *
from collections import Counter,defaultdict
from math import log2,ceil,floor,gcd,sqrt,log
from random import randrange
from bisect import bisect_left, bisect_right
from types import GeneratorType
from array import array

input = lambda: sys.stdin.buffer.readline().decode().rstrip()

def I():
    return input()

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

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

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

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

def LFI():
    return list(map(float, 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 out_list(lst) :
    sys.stdout.write(" ".join(map(str,lst)) + "\n")
######################################################################################

class dict_(dict):
    RANDOM = randrange(2 ** 62)

    def __init__(self, dd):
        super().__init__({k ^ self.RANDOM: v for k, v in dd.items()})

    def __missing__(self, key):
        return 0

    def __setitem__(self, key, value):
        super().__setitem__(key ^ self.RANDOM, value)

    def __getitem__(self, item):
        return super().__getitem__(item ^ self.RANDOM)

    def __contains__(self, item):
        return super().__contains__(item ^ self.RANDOM)

    def items(self):
        for k, v in super().items():
            yield (k ^ self.RANDOM, v)

    def keys(self):
        for k in super().keys():
            yield k ^ self.RANDOM

    def __repr__(self):
        return '{0}'.format({k ^ self.RANDOM: v for k, v in super().items()})

###############################################################################
# GRAPHS :

class disjointset:
    def __init__(self, n):
        self.rank, self.parent = array('i', [0] * (n + 1)), array('i', [i for i in range(n + 1)])
        self.n, self.even = n, array('b', [0] * (n + 1))

    def find(self, x):
        xcopy = x
        while x != self.parent[x]: x = self.parent[x]
        while xcopy != x:
            self.parent[xcopy], xcopy = x, self.parent[xcopy]
        return x

    def union(self, x, y):
        xpar, ypar = self.find(x), self.find(y)

        if xpar == ypar: return 1

        par, child = xpar, ypar
        if self.rank[xpar] < self.rank[ypar]:
            par, child = ypar, xpar

        elif self.rank[xpar] == self.rank[ypar]:
            self.rank[xpar] += 1

        self.parent[child] = par
        self.even[par] |= self.even[child]
        self.n -= 1
        return 0

###############################################################################

letters = [
    'a','b','c','d','e','f',
    'g','h','i','j','k','l',
    'm','n','o','p','q','r',
    's','t','u','v','w','x',
    'y','z']

###############################################################################
# Number Theory and Combinatorics :

def Divisors(n) :
    divisors = {}
    for num in [n]:
        lst = set()
        i = 1
        while i <= sqrt(num):

            if (num % i == 0) :
                # If divisors are equal, print only one
                if ( num / i == i) :
                    lst.add(i)
                else :
                    # Otherwise print both
                    lst.update([i,num//i])

            i = i + 1
        divisors[num] = list(lst)
    return divisors[num]

def inverse_mod(num):
    a = mod-2
    result = 1
    result=pow(num,a,mod)
    return result

# N = 10**6 + 20000
# spf = [0 for a in range(N)]
# def sieve():
#     spf[1] = 1
#     for a in range(2, N):
#         spf[a] = a

#     for a in range(4, N, 2):
#         spf[a] = 2
#     sq =  int(sqrt(N)) + 1
#     for a in range(3,sq):

#         if (spf[a] == a):

#             for b in range(a * a, N, a):

#                 if (spf[b] == b):
#                     spf[b] = a
# def getFactorisation(i):
#     ret = list()
#     while (i != 1):
#         ret.append(spf[i])
#         i = i // spf[i]
#     return ret
# def D(n) :
#     g = getFactorisation(n)
#     c = Counter(g)
#     g = [(k,v) for k,v in c.items() ]
#     ans = []
#     q = [(1,0)]

#     while q :
#         num,i = q.pop()
#         if i == len(g) :
#             ans.append(num)
#             continue
#         k = 1
#         for j in range(1+g[i][1]) :
#             q.append((num*k,i+1))
#             k *= g[i][0]
#     return ans

# def factorialAndModualrInverse(n,prime):
#     modInv = [1] * (n + 1)
#     factorial = [1] * (n + 1)
#     modInvFactorial=[1]*(n+1)
#     for i in range(2, n + 1):
#         modInv[i] = modInv[prime % i] * (prime - prime // i) % prime
#         factorial[i] = (factorial[i - 1] * i) % prime
#         modInvFactorial[i] = (modInvFactorial[i - 1] * modInv[i]) % prime
#     return factorial,modInvFactorial

# def getComb(n,r):
#     if r==0:
#         return 1
#     if(n<r) or (n==0 and r==0):
#         return 0
#     return (factorial[n]*modInvFactorial[r]*modInvFactorial[n-r])%mod

###############################################################################

# recursion limit fix decorator, change 'return' to 'yield' and add 'yield' before calling the function
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

###############################################################################
###############################################################################
###############################################################################
mod = 10**9 + 7
inf = float("inf")

# sieve()
# factorial,modInvFactorial=factorialAndModualrInverse(2 * 10**5 ,mod)

def solve():
    n,k = LII()
    arr = LII()
    arr.sort()
    mx = arr[-1]
    s = sum(arr[:-1])
    ans = 1
    if k >= mx*(n-1) - s :
        ans = n

    if k >= (mx-s%mx) or s%mx == 0  :
        nk = k
        ns =s
        if   s%mx != 0 :
            nk -= (mx-s%mx)
            ns += (mx-s%mx)
        ans = max(ans,1+ ns//mx)

    if s!=0 and (k >= (s-mx%s) or mx%s == 0)  :
        if   mx%s != 0 :
            k -= (s-mx%s)
            mx += (s-mx%s)
        ans =max(ans,1+s//mx)

    print(min(n,ans))
###############################################################################
###############################################################################
###############################################################################

for t 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 for the given problem, we need to focus on edge cases that can expose potential bugs in the algorithm. Here are the key points to consider:

1. **Large Number of Coins (k):** Ensure the algorithm can handle a large number of coins, which might allow buying a significant number of cards.
2. **Small Number of Distinct Card Types (n):** Test with a small number of card types to see how the algorithm handles the distribution.
3. **High Initial Card Counts (a_i):** Test with high initial counts of cards to check if the algorithm can handle large numbers efficiently.
4. **Zero Initial Card Counts (a_i):** Test with some card types having zero initial cards to see if the algorithm can handle such cases correctly.
5. **Single Card Type (n = 1):** Test with only one card type to check if the algorithm can handle this edge case.
6. **Multiple Test Cases:** Ensure the test input contains multiple test cases to cover different scenarios.

Given these considerations, here is a small-scale test input that is complete and valid:

```plaintext
5
3 10
3 2 2
2 5
1 1
1 1000000000000
1 1
4 2
0 0 1 1
2 20
0 1
```

Explanation:
1. **Test Case 1:** `n = 3`, `k = 10`, `a = [3, 2, 2]` - A small number of card types with moderate initial counts and a large number of coins.
2. **Test Case 2:** `n = 2`, `k = 5`, `a = [1, 1]` - A small number of card types with low initial counts and a moderate number of coins.
3. **Test Case 3:** `n = 1`, `k = 1000000000000`, `a = [1]` - A single card type with a very large number of coins.
4. **Test Case 4:** `n = 4`, `k = 2`, `a = [0, 0, 1, 1]` - A small number of card types with some zero initial counts and a small number of coins.
5. **Test Case 5:** `n = 2`, `k = 20`, `a = [0, 1]` - A small number of card types with one zero initial count and a large number of coins.

This test input covers a variety of scenarios and should help expose potential bugs in the algorithm.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
t = int(input(""))
for i in range(1,t+1):
    n_k = list(map(int, input().split()))
    n = n_k[0]
    k = n_k[1]
    a = list(map(int, input().split()))
    a_max = max(a)
    deck_height = int(sum(a)/a_max)
    top_layer_card = sum(a)%a_max
    if k >= a_max- top_layer_card  and deck_height < n :
        deck_height = deck_height + 1
        k = k - a_max + top_layer_card
        while deck_height < n and k > a_max :
            deck_height = deck_height + 1
            k = k - a_max
        print(deck_height)
    elif top_layer_card != 0 and  k < a_max- top_layer_card and deck_height < n:
        top_layer_card = sum(a)%(a_max+1)
        deck_height =  int(sum(a)/(a_max+1))
        if k >=  a_max+ 1 - top_layer_card:
            deck_height = deck_height +1

        print(deck_height)
    else:

        print(deck_height)

**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 given buggy code, we need to focus on edge cases and scenarios that can maximize the failure probability. The key issues in the buggy code are:

1. Incorrect handling of the maximum deck size calculation.
2. Incorrect handling of the remaining coins and how they are used to increase the deck size.
3. Potential off-by-one errors in the deck size calculations.

Let's consider a small-scale test input that can highlight these issues:

1. **Test Case with a Small Number of Cards and Coins:**
   - This will help verify the basic logic of the algorithm.
   - Example: \( n = 3 \), \( k = 1 \), \( a = [3, 2, 2] \)

2. **Test Case with a Large Number of Cards and Coins:**
   - This will test the algorithm's ability to handle large inputs.
   - Example: \( n = 5 \), \( k = 4 \), \( a = [2, 6, 1, 2, 4] \)

3. **Test Case with a Single Type of Card:**
   - This will test the algorithm's ability to handle a single type of card.
   - Example: \( n = 1 \), \( k = 0 \), \( a = [1] \)

4. **Test Case with a Large Number of Coins and a Single Type of Card:**
   - This will test the algorithm's ability to handle a large number of coins and a single type of card.
   - Example: \( n = 1 \), \( k = 100 \), \( a = [1] \)

5. **Test Case with a Large Number of Coins and Multiple Types of Cards:**
   - This will test the algorithm's ability to handle a large number of coins and multiple types of cards.
   - Example: \( n = 10 \), \( k = 8 \), \( a = [7, 4, 6, 6, 9, 3, 10, 2, 8, 7] \)

6. **Test Case with a Small Number of Coins and Multiple Types of Cards:**
   - This will test the algorithm's ability to handle a small number of coins and multiple types of cards.
   - Example: \( n = 2 \), \( k = 12 \), \( a = [2, 2] \)

7. **Test Case with a Zero Coin Case:**
   - This will test the algorithm's ability to handle zero coins.
   - Example: \( n = 3 \), \( k = 0 \), \( a = [2, 1, 2] \)

8. **Test Case with a Small Number of Cards and a Large Number of Coins:**
   - This will test the algorithm's ability to handle a small number of cards and a large number of coins.
   - Example: \( n = 3 \), \( k = 1 \), \( a = [0, 3, 3] \)

Here is the test input:

```plaintext
8
3 1
3 2 2
5 4
2 6 1 2 4
1 0
1
1 100
1
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
3 0
2 1 2
3 1
0 3 3
```

This test input covers a variety of scenarios that can help expose the bugs in the given buggy code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
#include<bits/stdc++.h>
using namespace std;

void solve()
{
    long long n, k;
    cin >> n >> k;
    vector<long long>a(n + 1);
    long long sum = 0;
    long long maxx = -INT_MAX;
    for (int i = 1;i <= n;i++)
    {
        cin >> a[i];
        sum += a[i];
        if (a[i] > maxx)
        {
            maxx = a[i];
        }
    }
    if ((sum + k) / maxx > sum / maxx)
    {
        cout << min(n, (sum + k) / maxx) << endl;
    }
    else
    {
        for (int i = 0;i <= k;i++)
        {
            if (sum % (sum / maxx) != 0 && (sum + k) % (sum / maxx) != 0)
            {
                cout << sum / maxx - 1 << endl;return;
            }
        }

        cout << sum / maxx << endl;

    }

}

//11 2 33
//sum = 15
//123 124 124
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        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:
```plaintext
1
3 2
3 2 1
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+5;
ll a[N];

ll mx,sum,k;

int check(ll x){
	if(x==1)return 1;
	return (__int128)x*mx-sum<=k;
}

void solve(){
	ll n;
	cin>>n>>k;
	sum=0,mx=-1;
	for(int i=1;i<=n;i++)cin>>a[i],sum+=a[i],mx=max(mx,a[i]);

	ll l=0,r=2e5+5;
	while(l<r){
		ll m=l+r>>1;
		if(check(m))l=m+1;
		else r=m;
	}
	ll ans=min(n,l-1);
	if(k==0){
		while(sum%ans)ans--;
	}
	cout<<ans<<endl;
}

int main(){
	int t;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 provided buggy code, we need to focus on edge cases and scenarios that maximize the failure probability. Let's break down the requirements and think through the potential issues:

1. **Edge Cases**:
   - **Small \( n \) and large \( k \)**: This can test the limits of the binary search and the check function.
   - **Large \( n \) and small \( k \)**: This can test the constraints of the sum and the maximum value.
   - **Equal distribution of cards**: This can test the uniformity in the partitioning.
   - **Zero cards for some types**: This can test the handling of zero values in the array.
   - **Single type of card**: This can test the edge case where only one type of card is present.

2. **Scenarios**:
   - **Large number of coins but limited card types**: This can test the scenario where the binary search might overshoot the optimal deck size.
   - **Small number of coins but many card types**: This can test the scenario where the binary search might undershoot the optimal deck size.
   - **Mixed distribution of cards with a few high-frequency cards**: This can test the handling of imbalanced distributions.

Given these considerations, let's create a test input that combines these elements:

```plaintext
5
3 10000000000
1 1 1
10 1
10000000000 0 0 0 0 0 0 0 0 0 0
10 0
1 2 3 4 5 6 7 8 9 10
5 5
1 2 3 4 5
2 10
10000000000 10000000000
```

This test input includes:
1. A small \( n \) and a large \( k \) with equal distribution of cards.
2. A large \( n \) and a small \( k \) with a single type of card.
3. A large \( n \) and a small \( k \) with a mixed distribution of cards.
4. A small \( n \) and a moderate \( k \) with a mixed distribution of cards.
5. A small \( n \) and a large \( k \) with a large number of cards of the same type.

This should help in exposing any issues in the binary search and the check function of the buggy code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
import java.util.Scanner;

public class Problem{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
       long t=sc.nextInt();
       for(long i=0;i<t;i++){
        long n=sc.nextLong();
        long k=sc.nextLong();
        long max=0;
        long total=0;
        long kp=0;

        for(long j=0;j<n;j++){
            long num=sc.nextLong();
            total+=num;
            if(num>max) max=num;
        }
        while(true){
            if(max*n==total){
            System.out.println(n);
            break;
        }
        else if(max*n>total){
            if(k>0){
                total++ ;
                k--;
                kp++;
                continue;
            }
            else {
                n--;
                total=total-kp;
                k=kp;
                kp=0;
                continue;
            }
        }
        else{
            if(k>0){
                total++;
                max++;
                k--;
                kp++;
                continue;
            }
            else{
                if(total%n==0){
                    System.out.println(n);
                    break;
                }else{
                    total=total-kp;
                    k=kp;
                    kp=0;
                    n--;
                }

            }
        }
        }

       }

    }

}

**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
3 2
1 2 2
4 3
1 1 1 1
5 5
1 2 3 4 5
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class Main {
    static void solve() throws Exception {
        int i, j, n, m;
        n = in.nextInt();
        long k = in.nextLong();

        long[] arr = new long[n];
        for (i=0; i<n; i++) arr[i] = in.nextLong();

        long sum = 0;
        long mx = 0;
        for (long a : arr) {
            sum += a;
            mx = max(mx, a);
        }

        if (sum/mx < n && (sum/mx < (sum+k)/mx || (sum+k)%mx == 0)) {
            out.println(min(n, (sum+k)/mx));
            return;
        }

        long rows = sum / mx;
        long cols = mx;
        long extra = sum % mx;

        if (sum/mx > n) {
            rows = n;
            cols = sum / n;
            extra = sum % n;
        }

        while (rows >= 0) {
            if (extra == 0 || extra+k >= rows) break;

            rows--;
            extra += cols;
            cols += extra / rows;
            extra %= rows;
        }

        out.println(rows);
    }

    public static void main(String... args) {
        try { in = new FastReader(); out = new FastWriter();
            test();
            out.close();
        } catch (Exception e) { e.printStackTrace(); }
    }
    static void test() throws Exception {
        int t = in.nextInt();
        while (t-- > 0) { solve(); }
    } static FastReader in; static FastWriter out; final static int mod = (int) 1e9 +7;
    static class FastReader {
        BufferedReader br; StringTokenizer st;
        public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); }
                catch (IOException e) { e.printStackTrace(); }
            } return st.nextToken();
        }
        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() { return Long.parseLong(next()); }
        double nextDouble() { return Double.parseDouble(next()); }
        char nextChar() { return next().charAt(0); }
        String nextLine() {
            String str = "";
            try { str = br.readLine().trim(); }
            catch (Exception e) { e.printStackTrace(); }
            return str;
        }
    } static class FastWriter {
        private final BufferedWriter bw;
        public FastWriter() { this.bw = new BufferedWriter(new OutputStreamWriter(System.out)); }
        public void print(Object object) throws IOException { bw.append("" + object); }
        public void println(Object object) throws IOException { print(object); bw.append("\n"); }
        public void close() throws IOException { bw.close(); }
    }
    static long gcd(long a, long b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }
}

**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, let's consider the following:

1. **Edge Cases**: The code might struggle with edge cases where the number of coins (`k`) is very large or where the distribution of card counts (`a_i`) is highly skewed.

2. **Large Number of Coins**: If the number of coins is very large, the code might not correctly handle the scenario where the `extra` value is adjusted in the while loop.

3. **Skewed Distribution**: If the distribution of card counts is highly skewed (e.g., one type of card has a very high count while others have very low counts), the code might not correctly calculate the optimal deck size.

Given these considerations, let's create a test input that includes a large number of coins and a skewed distribution of card counts.

```plaintext
1
4 100
1000000000 1 1 1
```

### Explanation:
- **Test Case Count**: 1
- **Number of Card Types (`n`)**: 4
- **Number of Coins (`k`)**: 100
- **Card Counts (`a_i`)**: 1000000000, 1, 1, 1

This input is designed to:
- Have a very high count for one type of card (1000000000) and very low counts for the others (1, 1, 1).
- Provide a large number of coins (100) to see how the code handles the adjustment of the `extra` value in the while loop.

This should challenge the code to correctly determine the maximum possible deck size, especially when the distribution is highly skewed and there are many coins available for buying additional cards.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Cards Partition
time_limit_ms: 2000
memory_limit_mb: 256
Description: [DJ Genki vs Gram - Einherjar Joker](https://soundcloud.com/leon- hwang-368077289/einherjar-joker-dj-genki-vs-gram)

You have some cards. An integer between $1$ and $n$ is written on each card: specifically, for each $i$ from $1$ to $n$, you have $a_i$ cards which have the number $i$ written on them.

There is also a shop which contains unlimited cards of each type. You have $k$ coins, so you can buy at most $k$ new cards in total, and the cards you buy can contain any integer between $\mathbf{1}$ and $\mathbf{n}$, inclusive.

After buying the new cards, you must partition all your cards into decks, according to the following rules:

  * all the decks must have the same size;    * there are no pairs of cards with the same value in the same deck.

Find the maximum possible size of a deck after buying cards and partitioning them optimally.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 2 \cdot 10^5$, $0 \leq k \leq 10^{16}$) — the number of distinct types of cards and the number of coins.

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^{10}$, $\sum a_i \geq 1$) — the number of cards of type $i$ you have at the beginning, for each $1 \leq i \leq n$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.

Output: For each test case, output a single integer: the maximum possible size of a deck if you operate optimally.

Examples:
input:
9
3 1
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
10 8
7 4 6 6 9 3 10 2 8 7
2 12
2 2
2 70
0 1
1 0
1
3 0
2 1 2
3 1
0 3 3
output:
2
3
1
7
2
2
1
1
2

Note: In the first test case, you can buy one card with the number $1$, and your cards become $[1, 1, 1, 1, 2, 2, 3, 3]$. You can partition them into the decks $[1, 2], [1, 2], [1, 3], [1, 3]$: they all have size $2$, and they all contain distinct values. You can show that you cannot get a partition with decks of size greater than $2$, so the answer is $2$.

In the second test case, you can buy two cards with the number $1$ and one card with the number $3$, and your cards become $[1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5]$, which can be partitioned into $[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5]$. You can show that you cannot get a partition with decks of size greater than $3$, so the answer is $3$.

Buggy Code:
for __ in range(int(input())):
  n, k = map(int, input().split())
  a = list(map(int, input().split()))

  total = sum(a)
  num = max(a)

  size = total // num
  rem = total % num

  remSize = (rem + k) // num

  if remSize == 0:
    remCards = size - rem
    if k < remCards:
      while rem % size != 0:
        rem += num
        size -= 1

  print(min(size + remSize, n))

**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
3 0
3 2 2
5 4
2 6 1 2 4
2 100
1410065408 10000000000
```