Skip to main content
OlympiadHQ

Browse · MathNet

Print

Team selection tests

Vietnam counting and probability

Problem

A school has two classes and which have and students each. The students of the two classes sit in a circle. Each student is then given a number of candies equal to the number of consecutive students sitting to the left of him that are from his same class. After distributing the candies, the teacher decides to group the students such that in each group, all the students receive the same amount of candies, and any two students from two different groups should receive a different amount of candies. a) What is the maximum number of students that a group can have? b) Excluding the group where every student receives no candies, what is the maximum number of students that a group can have?
Solution
Arrange students on a circle forming the arcs on which any two students are in the same class, and as few arcs as possible. Obviously with this division, two adjacent arcs contain students who are not in the same class. We claim that the number of students have candies is exactly the same as the number of arcs with at least people. Indeed, if there is a student with candies, that means on the left hand side of , there are exactly classmates, so the arc contains at least people. On the other hand, for each arc that has at least people, the students from the left side has exactly candies.

a) Since the number of students with candies is equal to the number of arcs with at least people, the number of students without candy is exactly the same as the number of arcs. On the other hand, the number of students with candies is equal to the number of arcs with at least people, and does not exceed the number of arcs of people, so the number of students that have candies is the largest. We will prove that the maximum number of arcs is Suppose that . Obviously, the maximum number of arcs that students are both in class is . On the other hand, the number of arcs containing students from is equal to the number of arcs containing students from , because between consecutive arcs containing classmates there is exactly arc containing classmates. So the number of arcs is twice times the number of arcs containing students from and no more than . Equivalently, a group has at most students. The equality is obtained when we arrange the arcs with student from class , and arcs of students from .

b) For the same argument as above, the number of arcs containing at least people is equal to the number of students having of candy, an arc contains at least where does not exceed the number of arcs containing at least people, so we count the number of arcs containing at least person and find the maximum number of such arcs. Assume . If there are arcs of students from then there are arcs of students from . Suppose there are arcs with at least classmate of and arcs with at least classmate of . We have two cases. If or and they are even. Since the number of arcs includes exactly classmate of does not exceed , so the maximum number of arcs is . Thus, or . We show the equality holds. If then divide into arcs, each arc has at least students, this is possible because . So there are arcs.

◦ If then divide class into arcs of person and remaining person. Since , then , class can be divided into arcs, each of which has at least people. Therefore, we get arcs with at least students and a group has at most students. • If . It's easy to see and so or having a maximum of also has at least people. The equality holds if dividing each class into arcs, where contains friends and arc contains friends and then alternates on the circle.

In conclusion, the answer is when is odd and in the rest of the cases.
Final answer
a) 2·min(m, n). b) min(m, n), except when m = n is odd, in which case it is m − 1.

Techniques

Coloring schemes, extremal argumentsCounting two ways