#K92172. Product Filter
Product Filter
Product Filter
In this problem, you are given a list of products, each having an ID, a name, a seller ID, a price, and a category. Your task is to filter the products based on a given price range ( [MIN, MAX] ) and a specified category. The filtered products must then be sorted first by price (in ascending order) and then by product ID (also in ascending order). If no product meets the criteria, output the string "No products found". This problem tests your ability to parse input, filter data, and sort collections.
inputFormat
The input is read from standard input (stdin) and has the following format:\
- The first line contains an integer ( N ) indicating the number of products.\
- The next ( N ) lines each contain details for one product in the following order separated by spaces:( product_id ) (integer), ( product_name ) (string), ( seller_id ) (integer), ( price ) (integer), and ( category ) (string).\
- The last line contains two integers ( MIN ) and ( MAX ) followed by a string ( Category ), all separated by spaces.
outputFormat
Output to standard output (stdout). If there are products that match the filtering criteria, print each product on a separate line in the format: ( product_id product_name seller_id price category ). The products must be printed sorted by price (ascending) and, in case of ties, by product ID (ascending). If no product meets the criteria, print exactly one line with the text "No products found".## sample
5
101 phone 2001 500 electronics
102 laptop 2002 1500 electronics
103 watch 2003 300 accessories
104 phone 2004 700 electronics
105 headphones 2005 200 accessories
300 1000 electronics
101 phone 2001 500 electronics
104 phone 2004 700 electronics
</p>