F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Contest Remake

Time Limit: 16000/8000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 119    Accepted Submission(s): 25


Problem Description
The annual Chengdu Children Poker Contest (CCPC) has begun! Unfortunately, the cards have been all blown away during the contest and the contest cannot go ahead. You, as the contest organizer, need to prepare a rematch and reproduce a pack of cards for the rematch.

The cards used in the contest are quite special — each card represents a set of integers. For a pack of $m$ cards, we denote the set represented by each card as $S_1,S_2,\dots,S_m$. The pack of the cards should meet the following conditions:

- The elements in each set are unordered and distinct.
- For every $i$, $S_i \subset \mathbb{Z}^+$ (the set of all positive integers), and $S_i \neq \emptyset$.
- For every $1 \le i \lt j \le m$, $S_i \neq S_j$.
- For every $i$, $\prod_{x \in S_i}x \le C$, where $C$ is a given constant.

What's more, a mystery guy tells you the reason why the cards are blown away is that you use some ominous integers. There are $n$ ominous integers, and you should avoid using them in case your cards get blown away again. We denote the set of ominous integers as $T$. That is:

- For every $i$, $S_i \cap T=\emptyset$.

You want to reproduce as many cards as possible. Now given $C$ and the $n$ ominous integers, please calculate the maximum number of cards in the pack.
 

Input
The first line contains a positive integer $T$ $(1\le T \le 20)$, indicating the number of test cases.

For each test case, the first line contains two integers $n, C$ $(0\le n\le 10^{5},1\le C \le 10^{9})$, indicating the number of ominous integers and the given constant.

The second line contains $n$ positive integers $a_1,a_2,\dots,a_n$ $(1\le a_i \le C)$, indicating the ominous integers. It is guaranteed that all the $n$ integers are distinct.

It is guaranteed that $\sum n\le 7\times 10^5$, and there are at most $10$ test cases that meet $C>10^6$.
 

Output
For each test case, print one integer in a single line, indicating the maximum number of cards in the pack.
 

Sample Input
2 1 6 3 2 10 3 5
 

Sample Output
9 17
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-11 18:19:06, Gzip enabled