#K92147. Loyal Customers
Loyal Customers
Loyal Customers
You are given the purchase records of several customers. For each customer, you are provided a sequence of integers where each integer represents whether the customer made a purchase in a month. A value of 1 indicates that the customer made a purchase, and 0 indicates they did not.
Your task is to determine whether each customer is "Loyal" or "Not Loyal". A customer is considered Loyal if they made a purchase in every month; otherwise, they are Not Loyal.
The input will be provided in the standard input with the first line containing an integer T denoting the number of customers. The following T lines each contain a series of space-separated integers representing the purchase record for that customer.
You must output T lines, each containing either "Loyal" or "Not Loyal", corresponding to the evaluation of each customer's purchase record.
inputFormat
Standard Input Format:
- The first line contains a single integer
T
which denotes the number of customers. - Each of the next
T
lines contains a sequence of space-separated integers. Each integer is either 0 or 1, representing whether a purchase was made for that particular month.
outputFormat
Standard Output Format:
Output T
lines, where each line contains either "Loyal" or "Not Loyal". Print "Loyal" if the corresponding customer's record contains only 1's; otherwise, print "Not Loyal".
3
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
Loyal
Loyal
Loyal
</p>