#K79742. Maximize Seated Customers Under Stress Constraint
Maximize Seated Customers Under Stress Constraint
Maximize Seated Customers Under Stress Constraint
You are given (n) customers, each having a satisfaction level and a stress level represented by a pair of integers. The goal is to seat as many customers as possible while ensuring that only those with a stress level strictly less than 8 are seated. In other words, you must count the number of customers for which the stress level (s < 8).
The input consists of (n) followed by (n) lines, each containing two integers: the satisfaction level and the stress level. Your task is to output the maximum number of customers that can be seated, which is effectively the count of customers with stress level less than 8.
inputFormat
The first line contains a single integer (n) indicating the number of customers. The following (n) lines each contain two space-separated integers, representing the satisfaction level and the stress level respectively.
outputFormat
Output a single integer representing the maximum number of customers that can be seated (i.e. those with a stress level less than 8).## sample
5
5 4
3 6
8 9
2 10
6 3
3