#C2018. Critical Oxygen Level Detection
Critical Oxygen Level Detection
Critical Oxygen Level Detection
In many emergency scenarios, monitoring oxygen levels is crucial to ensuring safety. Hospitals and rescue teams often use sensor data from various locations to determine which areas are at risk due to low oxygen. Given several test cases, each describing a set of oxygen levels from different locations and a critical threshold, your task is to identify the 1-indexed positions where the oxygen level falls below the threshold. If all locations meet or exceed the threshold, output Safe
.
For each test case, the input consists of two lines:
- The first line contains two integers \(N\) and \(M\), where \(N\) represents the number of locations and \(M\) is the critical oxygen threshold.
- The second line contains \(N\) space-separated integers representing the oxygen levels at each location.
Output one line per test case. The output should be a space-separated string of indices (1-indexed) where the oxygen levels are below (M). If no location is below the threshold, output Safe
.
inputFormat
The first line of input contains an integer (T) representing the number of test cases. For each test case, the first line contains two integers (N) and (M) (the number of locations and the oxygen threshold respectively). The following line contains (N) integers, each representing the oxygen level of a location.
outputFormat
For each test case, output a single line containing either a space-separated list of 1-indexed position numbers where the oxygen level is lower than (M), or output Safe
if no location is critical.## sample
3
5 50
60 30 55 70 45
4 40
42 43 44 39
3 20
25 30 40
2 5
4
Safe
</p>