cpp
int n = 0, d = 0, x = 0, cx = 0, cd = 0, s = 0;
cin >> n >> x; cx = d = x;//5 2 6 4 10 20//4 6 4 10 20//6 0 4 2 6 10 20//5 20 10 4 6 2
sr:if (--n)
{//缘由https://ask.csdn.net/questions/8070245
cin >> s;
if (s < x)cx = x, x = s;
if (s > d)cd = d, d = s;
if (s > x && (s < cx || x == cx))cx = s;
if (s < d && (s > cd || d == cd))cd = s;
goto sr;
}
cout << (d - x) / (cx - x) + 1 << "\n";

我以此施而自庄严,不求人天无常,愿真正无上道成,若获无尽宝藏施无逆意。
2026年元旦快乐!