#K95902. Task Duration Reduction
Task Duration Reduction
Task Duration Reduction
You are given a list of tasks. Each task is represented by a task name and its duration in minutes. You are also given a threshold value \(T\). Your job is to filter out tasks whose duration is at least \(T\) and then reduce the duration of these tasks by subtracting \(T\) from their original duration.
Formally, for each task with duration \(d\) and threshold \(T\), if \(d \ge T\) then the reduced duration is \(d - T\). If no task meets the threshold, output nothing.
The input will be given via stdin, and you must print the output to stdout.
inputFormat
The first line of input contains two integers \(n\) and \(T\) where \(n\) is the number of tasks and \(T\) is the threshold.
This is followed by \(n\) lines, each containing a task name (a string without spaces) and an integer representing the duration of the task in minutes, separated by spaces.
outputFormat
For each task that meets or exceeds the threshold, output a line containing the task name and its reduced duration (i.e. original duration minus \(T\)), separated by a space. The order of output must be the same as the input order. If no task qualifies, output nothing.
## sample3 25
disassemble 50
recharge 20
calibrate 30
disassemble 25
calibrate 5
</p>