#K35467. Delivery Status
Delivery Status
Delivery Status
You are given a number of delivery routes. Each route is represented by a sequence of integers that indicate the status of a package at different cities along the route. A package is considered to be successfully delivered on a route if there exists at least one city where the status is \(2\). Otherwise, the delivery is unsuccessful.
Your task is to determine the delivery status for each route. For each route, output True
if the route contains the status \(2\) (i.e. the package is delivered), and False
otherwise.
Note: A route with no cities (i.e. an empty route when the number of routes is 0) should produce no output.
inputFormat
The input is read from standard input (stdin) and has the following format:
n route_1 route_2 ... route_n
Here, the first line contains an integer n
representing the number of routes. The next n
lines each represent a delivery route. Each route is given as a line of space-separated integers, where each integer represents the status code in a city along that route.
outputFormat
Output a single line to standard output (stdout) containing n
boolean values separated by a single space. Each value should be True
if the corresponding route has at least one occurrence of the integer \(2\), and False
otherwise.
3
0 1 0 0 2
0 1 2 1 0
1 1 0 2 0
True True True