Question: Please code in Python Constraints 1

Please code in Python Constraints 1 <= N <= 5000, where N is the number of bins in your inventory. 0 <= P <= 108, where P is the pollutant level of a tank. 1 <= M <= 500, where M is the number of bins the truck can carry. M <= N Inpts The first line of the input contains two integers separated by a space: the number N of bins in inventory and the number M of bins that can be transported by the truck. The second line contains N integers separated by spaces: the pollution level of each of the bins in your stock. Output You must write a line on the output, containing M integers separated by spaces: the pollution level of the M bins placed in the truck, in the order the robot took them out of the stock.

Example

Input :

6 4 3 2 17 0 10 3

Output :

17 10 3 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!