CodechefMay 31, 2025

Water Filling

Hazrat Ali

Codechef

Chef has three water bottles. At any point, if at least two of them are empty, she will fill them up. But if at most one bottle is empty, she will wait, and not fill them up now.

You are given three integers - B1,B2,B1,B2, and B3B3.
If B1=1, it means that the first bottle is full.
If B1=0, it means that the first bottle is empty.
Similarly, B2B2 denotes whether the second bottle is full or empty, and B3B3 denotes it for the third bottle.

Output "Water filling time", if Chef has to fill the bottles now. If not, output "Not now".

Input Format

  • The first line of input will contain a single integer TT, denoting the number of test cases.
  • The only line of each test case contains three space-separated integers, B1,B2,B3B1,B2,B3.

Output Format

For each test case, output on a new line, either "Water filling time", or "Not now".

Constraints

  • 1≤T≤1000
  • BiBi is either 00 or 11

Sample 1:

Input
5
0 0 0
1 1 1
1 1 0
0 1 0
0 1 1

Output
Water filling time
Not now
Not now
Water filling time
Not now


Solution
m = int(input())
for _ in range(m):
    a, b, c = map(int, input().split())
    if (a == 0 and b == 0 and c == 0) or\
       (a == 1 and b == 0 and c == 0) or\
       (b == 1 and a == 0 and c == 0) or\
       (c == 1 and a == 0 and b == 0):
       
        print("Water filling time")

    else:
        print("Not now")






 

Comments