MathLabs

Problem 4

Let nn be a fixed positive odd integer. Take m+2m+2 distinct points P0,P1,…,Pm+1P_0,P_1,\ldots,P_{m+1} in the coordinate plane such that: (1) P0=(0,1)P_0=(0,1), Pm+1=(n+1,n)P_{m+1}=(n+1,n), and for 1≤i≤m1\le i\le m, both coordinates of PiP_i are integers between 11 and nn inclusive; (2) for 0≤i≤m0\le i\le m, segment PiPi+1P_iP_{i+1} is parallel to the xx-axis if ii is even and to the yy-axis if ii is odd; (3) for 0≤i<j≤m0\le i<j\le m, segments PiPi+1P_iP_{i+1} and PjPj+1P_jP_{j+1} share at most one point. Determine the maximum possible value of mm.
Step 1 of 5: Count turning points
m≤n(n−1)m\le n(n-1)
Detailed analysis

Call P1,…,PmP_1,\ldots,P_m turning points. Every turning point is vertically adjacent to exactly one other turning point, so at each fixed x=k∈{1,…,n}x=k\in\{1,\ldots,n\} their number is even and at most n−1n-1. Therefore m≤n(n−1)m\le n(n-1).