CF1760F.Quests

传统题 时间 2000 ms 内存 256 MiB 8 尝试 21 已通过 10 标签

Quests

There are nn quests. If you complete the ii-th quest, you will gain aia_i coins. You can only complete at most one quest per day. However, once you complete a quest, you cannot do the same quest again for kk days. (For example, if k=2k=2 and you do quest 11 on day 11, then you cannot do it on day 22 or 33, but you can do it again on day 44.)

You are given two integers cc and dd. Find the maximum value of kk such that you can gain at least cc coins over dd days. If no such kk exists, output Impossible. If kk can be arbitrarily large, output Infinity.

Input

The input consists of multiple test cases. The first line contains an integer tt (1t1041 \leq t \leq 10^4) — the number of test cases. The description of the test cases follows.

The first line of each test case contains three integers n,c,dn,c,d (2n21052 \leq n \leq 2\cdot10^5; 1c10161 \leq c \leq 10^{16}; 1d21051 \leq d \leq 2\cdot10^5) — the number of quests, the number of coins you need, and the number of days.

The second line of each test case contains nn integers a1,a2,,ana_1, a_2, \dots, a_n (1ai1091 \leq a_i \leq 10^9) — the rewards for the quests.

The sum of nn over all test cases does not exceed 21052\cdot10^5, and the sum of dd over all test cases does not exceed 21052\cdot10^5.

Output

For each test case, output one of the following.

  • If no such kk exists, output Impossible.
  • If kk can be arbitrarily large, output Infinity.
  • Otherwise, output a single integer — the maximum value of kk such that you can gain at least cc coins over dd days.

Please note, the checker is case-sensitive, and you should output strings exactly as they are given.

Note

In the first test case, one way to earn 55 coins over 44 days with k=2k=2 is as follows:

  • Day 1: do quest 2, and earn 22 coins.
  • Day 2: do quest 1, and earn 11 coin.
  • Day 3: do nothing.
  • Day 4: do quest 2, and earn 22 coins.

In total, we earned 2+1+2=52+1+2=5 coins.

In the second test case, we can make over 2020 coins on the first day itself by doing the first quest to earn 100100 coins, so the value of kk can be arbitrarily large, since we never need to do another quest.

In the third test case, no matter what we do, we can't earn 100100 coins over 33 days.

Samples

6
2 5 4
1 2
2 20 10
100 10
3 100 3
7 2 6
4 20 3
4 5 6 7
4 100000000000 2022
8217734 927368 26389746 627896974
2 20 4
5 1
2
Infinity
Impossible
1
12
0

在线编程 IDE

建议全屏模式获得最佳体验