#K38072. Locker Security System
Locker Security System
Locker Security System
You are given a system with T lockers. Each locker is in one of 50 possible states represented by an integer. A locker is considered unlocked if its state value is even, and locked if its state value is odd.
Your task is to write a program that reads the total number of lockers and their corresponding states, then calculates and prints the number of unlocked and locked lockers.
The problem is formulated as follows:
Given an integer \(T\) (\(1 \leq T \leq 10^5\) for example) and a list of \(T\) integers \(L_1, L_2, \dots, L_T\) (where \(1 \leq L_i \leq 50\)), count the number of even numbers (unlocked lockers) and odd numbers (locked lockers) and output them.
Note: Input is provided via standard input (stdin) and output should be printed to standard output (stdout).
inputFormat
The first line contains an integer \(T\) which represents the total number of lockers. The second line contains \(T\) space-separated integers representing the state of each locker.
Example:
5 2 3 4 5 6
outputFormat
Output two integers separated by a space: the number of unlocked lockers (even) and the number of locked lockers (odd).
Example:
3 2## sample
5
2 4 6 8 10
5 0