#K76387. Maximum Even Sum Pairs
Maximum Even Sum Pairs
Maximum Even Sum Pairs
You are given a positive integer \(t\) representing the number of packets. Each packet contains a certain number of almonds. For each packet, determine the maximum number of pairs of almonds that can be formed such that the sum of the two almonds in a pair is even. Since the sum of two even numbers (or two odd numbers) is always even, the answer for a packet with \(n\) almonds is given by:
$$\left\lfloor \frac{n}{2} \right\rfloor$$
A pair is defined as exactly two almonds. You need to output the results for all packets in the order they are given.
inputFormat
The input is read from stdin and has the following format:
- The first line contains a single integer \(t\) denoting the number of packets.
- The second line contains \(t\) space-separated integers, where the \(i\)-th integer represents the number of almonds in the \(i\)-th packet.
outputFormat
Print a single line to stdout containing \(t\) space-separated integers. The \(i\)-th integer should be the maximum number of pairs (each pair containing two almonds) that can be formed from the \(i\)-th packet, computed as \(\lfloor n/2 \rfloor\).
## sample1
4
2