#K74322. Relay Teams Formation
Relay Teams Formation
Relay Teams Formation
In this problem, you are given the number of classes and the number of students in each class. Your task is to determine how many teams of 4 students can be formed for each class. A team can be formed only if the number of students in the class is divisible by 4. More formally, for a class with ( s ) students, if ( s \equiv 0 \pmod{4} ), then the number of teams is ( \frac{s}{4} ); otherwise, the answer is -1.
inputFormat
The input consists of two lines. The first line contains an integer ( n ), the number of classes. The second line contains ( n ) space-separated integers, where each integer represents the number of students in a class.
outputFormat
Output a single line containing ( n ) space-separated integers. For each class, output the number of teams that can be formed (i.e., ( \frac{s}{4} ) if ( s ) is divisible by 4), or -1 if a team cannot be formed.## sample
3
8 15 12
2 -1 3