First let us change the order: a1=bm, a2=bm−1, ..., am=b1. Then we have 1≤bm≤bm−1≤⋯≤b2≤b1≤400. Let us show that bk≤k400, 1≤k≤m. If k=1, it is true.
For the induction step, we need to prove that bk+1≤k+1400. By the condition
bk−bk+1≥(bk,bk+1)=[bk,bk+1]bk⋅bk+1≥400bk⋅bk+1
holds. From this inequality we have bk+1≤bk+400400bk=1+bk400400≤1+k400. Hence bk400≥k.
The 1≤bm≤bm−1≤⋯≤b20≤20400=20. Since bi is integer for 1≤i≤m, m≤40.