#C4710. Garden Sprinkler Automation
Garden Sprinkler Automation
Garden Sprinkler Automation
Rosie is a digital garden enthusiast aiming to automate her garden’s water-sprinkling system using data from moisture sensors. The sensors record the moisture levels of various garden sections as a sequence of integers. Your task is to determine which sections need watering. For each test case, you are given a threshold value M. Output the 0-based indices of all sections where the moisture level is strictly less than M. If no sections meet this criterion, output None
.
This problem can be defined mathematically as follows: given an array \(A = [A_0, A_1, \dots, A_{N-1}]\) and a threshold \(M\), find all indices \(i\) such that \(A_i < M\).
inputFormat
The first line of input contains an integer T
representing the number of test cases. Each test case consists of two lines:
- The first line contains two integers
N
andM
, whereN
is the number of garden sections andM
is the moisture threshold. - The second line contains
N
integers representing the moisture levels of the garden sections.
outputFormat
For each test case, output a single line. Print the 0-based indices of the sections that need watering (i.e. those with moisture level less than M
), separated by a space. If no section meets the criteria, print None
.
3
5 30
40 20 35 25 45
4 50
55 60 45 50
4 40
45 50 55 60
1 3
2
None
</p>