#K48932. Internet-Enabled Laptop Connectivity
Internet-Enabled Laptop Connectivity
Internet-Enabled Laptop Connectivity
In this problem, you are given a set of friends, each with a collection of laptops. Each laptop is marked with either a 0 or a 1, where 1 indicates that the laptop has internet capability and 0 indicates that it does not. The goal is to determine if it is possible to configure the network such that every friend has at least one laptop with internet connectivity. In mathematical terms, for each friend (i) (where (1 \leq i \leq n)), there must exist at least one laptop (j) for which (a_{ij} = 1). If this condition is met for every friend, output "Possible"; otherwise, output "Impossible".
inputFormat
Input is provided via standard input (stdin). The first line contains a single integer (n) denoting the number of friends. This is followed by (n) lines. Each of these lines contains space-separated integers representing the internet capability of each laptop for that friend. Each integer is either 0 (no internet) or 1 (has internet). The number of integers in a line can vary.
outputFormat
Output a single line containing either "Possible" if every friend has at least one laptop with internet capability, or "Impossible" otherwise. The output is printed to standard output (stdout).## sample
3
1 0
0 1 0
1 1
Possible