Maths Olympiad Prep

Track / Stage 6 / 379 of 400 #1379 of 1964

Problem 1379

National olympiad, first round
Combinatorics Difficulty 6.9 Find the answer

Given two positive integers mm and nn, find the largest kk in terms of mm and nn such that the following condition holds:

Any tree graph GG with kk vertices has two (possibly equal) vertices uu and vv such that for any other vertex ww in GG, either there is a path of length at most mm from uu to ww, or there is a path of length at most nn from vv to ww.

Proposed by Ivan Chan

A number or a short expression. Spacing, $ signs and \frac vs / are all fine.

Official solution

1. **Assume nm n \ge m **: Without loss of generality, we can assume nm n \ge m to simplify the problem.
2. **Determine the largest k k **: We need to find the largest k k such that any tree graph G G with k k vertices has two vertices u u and v v satisfying the given condition.
3. Upper Bound Analysis:
- For k2n+2m+3 k \ge 2n + 2m + 3 , consider a path of length 2n+2m+3 2n + 2m + 3 . This path serves as a counterexample because there will be vertices that are too far apart to satisfy the condition.
- For k3n+3 k \ge 3n + 3 , consider three disjoint paths with lengths n+1,n+1,n n+1, n+1, n respectively, and connect these paths with a new vertex at their endpoints. This construction also serves as a counterexample.
4. Lower Bound Analysis:
- Assume kmin(2n+2m+2,3n+2) k \le \min(2n + 2m + 2, 3n + 2) and suppose we cannot find such vertices u u and v v .
- Let A1A2At A_1A_2 \dots A_t be a diameter of the tree, and let Gi G_i be the subtree of Ai A_i not intersecting with the diameter.
- If t2n t \le 2n , choosing v=At2 v = A_{\lfloor \frac{t}{2} \rfloor} works because the diameter is short enough.
- Assume t>2n t > 2n .
5. Choosing Vertices:
- Choose v=An+1 v = A_{n+1} and u=Atm u = A_{t-m} . There must exist a vertex a a such that d(a,v)>n d(a, v) > n and d(a,u)>m d(a, u) > m . If aGi a \in G_i , then n+1<i<tm n+1 < i < t-m by the diameter assumption.
- Choose v=Atn v = A_{t-n} and u=Am+1 u = A_{m+1} . There must exist a vertex b b such that d(b,v)>n d(b, v) > n and d(b,u)>m d(b, u) > m . If bGj b \in G_j , then m+1<j<tn m+1 < j < t-n by the diameter assumption.
6. Contradiction:
- If i=j i = j , then n+1<i<tn n+1 < i < t-n . This implies there are at least n+n+d(An+1,a)+23n+3 n+n+d(A_{n+1}, a) + 2 \ge 3n + 3 vertices, which contradicts our assumption.
- If ij i \neq j , let x=d(a,Ai) x = d(a, A_i) and y=d(b,Aj) y = d(b, A_j) . Summing the inequalities x+d(Ai,An+1)n+1 x + d(A_i, A_{n+1}) \ge n+1 and x+d(Atm,Ai)m+1 x + d(A_{t-m}, A_i) \ge m+1 , we get 2x+(tmn1)m+n+2 2x + (t-m-n-1) \ge m+n+2 . Similarly, we get 2y+(tmn1)m+n+2 2y + (t-m-n-1) \ge m+n+2 . Summing these, we get x+y+t2n+2m+3 x + y + t \ge 2n + 2m + 3 . Since ij i \neq j , there are at least x+y+t x + y + t vertices in the tree, which is a contradiction.

Therefore, the largest k k is min(2n+2m+2,3n+2) \min(2n + 2m + 2, 3n + 2) .

The final answer is min(2n+2m+2,3n+2) \boxed{\min(2n + 2m + 2, 3n + 2)} .

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.