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

Cut the rope

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 822    Accepted Submission(s): 390


Problem Description
  Now we have some ropes. For each rope, you can cut it only once at any place, or you can also do nothing on it.
  If we cut these ropes optimally, how many ropes we can get at most with the same length?
 

Input
  There is an integer T (1 <= T <= 100) in the first line, indicates there are T test cases in total.
  For each test case, the first integer N (1 <= N <= 100000) indicates there are N ropes. And then there are N integers whose value are all in [1, 100000], indicate the lengths of these ropes.
 

Output
  For each test case, you should output one integer in one line, indicates that the number of ropes we can get at most with the same length if we cut these ropes optimally.
 

Sample Input
3 1 1 2 1 2 3 2 3 3
 

Sample Output
2 3 5
 

Hint

  For Sample 1, we can get two ropes with 0.5 unit length.
  For Sample 2, we can get three ropes with 1 unit length.
  For Sample 3, we can get five ropes with 1.5 unit length.
 

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-11-26 04:01:01, Gzip enabled