#K10916. Reorder Alert
Reorder Alert
Reorder Alert
You are given a list of products along with their current stock levels and reorder thresholds. For each product, if the current stock level $$S$$ is less than or equal to the reorder threshold $$R$$, then that product requires a reorder. Otherwise, it does not need to be reordered.
The input begins with an integer $$P$$ which denotes the number of products. Each of the following $$P$$ lines contains the product identifier (a string), the current stock level $$S$$ (an integer), and the reorder threshold $$R$$ (an integer), separated by whitespace.
Your program should output the list of product identifiers that require a reorder. If none of the products require a reorder, print No reorder needed
. Each product identifier that needs reordering should be printed on a new line in the order they appear.
inputFormat
The first line contains an integer $$P$$ representing the number of products. Each of the next $$P$$ lines contains three elements separated by spaces:
- A product identifier (string).
- The current stock level $$S$$ (integer).
- The reorder threshold $$R$$ (integer).
If $$P = 0$$, there are no products.
outputFormat
If one or more products require a reorder (i.e. for a product, $$S \le R$$), output each qualifying product identifier on its own line in the order of input. If no product requires a reorder, output a single line with the text No reorder needed
.
3
item123 20 15
item456 10 20
item789 5 5
item456
item789
</p>