#K45407. Skyscraper Windows
Skyscraper Windows
Skyscraper Windows
In this problem, you are given information about multiple skyscrapers. Each skyscraper has four parts representing the number of windows in different sections, and a range defined by two integers indicating the minimum and maximum acceptable total window count.
Your task is to determine, for each skyscraper, whether the sum of its four window counts lies within the inclusive range \(low \leq a+b+c+d \leq high\). If the condition is met, output the four window counts (in the same order) separated by a space; otherwise, output impossible
.
inputFormat
The input is read from standard input and is structured as follows:
- An integer \(k\), representing the number of skyscrapers.
- For each skyscraper, there are two consecutive lines:
- The first line contains four integers: \(a\), \(b\), \(c\), \(d\) — the window counts for each section.
- The second line contains two integers: \(low\) and \(high\), the inclusive lower and upper bounds for the total number of windows.
outputFormat
For each skyscraper, print a single line to standard output. If the sum \(a+b+c+d\) is within the range \([low, high]\), output the four integers separated by a single space. Otherwise, output the string impossible
.
2
10 20 30 40
50 100
0 15 20 0
25 50
10 20 30 40
0 15 20 0
</p>