has n squares of stature h1,h2,… ,hn, and everything howdy don't surpass some worth x. He intends to stack all n blocks into m separate pinnacles. The tallness of a pinnacle is essentially the amount of the statures of its squares. For the pinnacles to look lovely, no two pinnacles might have a tallness distinction of stringently more

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Correct answer will be upvoted else downvoted.

 

Phoenix has n squares of stature h1,h2,… ,hn, and everything howdy don't surpass some worth x. He intends to stack all n blocks into m separate pinnacles. The tallness of a pinnacle is essentially the amount of the statures of its squares. For the pinnacles to look lovely, no two pinnacles might have a tallness distinction of stringently more than x. 

 

Kindly assist Phoenix with building m pinnacles that look excellent. Each pinnacle should have somewhere around one square and all squares should be utilized. 

 

Input 

 

The input comprises of numerous experiments. The principal line contains an integer t (1≤t≤1000) — the number of experiments. 

 

The primary line of each experiment contains three integers n, m, and x (1≤m≤n≤105; 1≤x≤104) — the number of squares, the number of pinnacles to fabricate, and the greatest OK tallness distinction of any two pinnacles, separately. 

 

The second line of each experiment contains n space-isolated integers (1≤hi≤x) — the statures of the squares. 

 

It is ensured that the amount of n over all the experiments won't surpass 105. 

 

Output 

 

For each experiment, if Phoenix can't fabricate m pinnacles that look excellent, print NO. In any case, print YES, trailed by n integers y1,y2,… ,yn, where yi (1≤yi≤m) is the list of the pinnacle that the I-th block is put in.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY