Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll LINF = 1LL<<29;
const int INF = 1e9;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int main()
{
  int N;
  cin >> N;
  int A[N];
  rep(i, 0, N)cin >> A[i];

  rep(i, 0, N){
    int max = , min;
    rep(j, 0, N){
      if (i == j)continue;
      max = max(A[j], max);
      min = min(A[j], min);
    }
    cout << 2 * abs(max - min) << endl;
  }
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
 
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
 
#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)
 
int main()
{
  int N, D, X;
  cin >> N >> D >> X;
  int A[N];
  rep(i, 0, N)cin >> A[i];
 
  int ans = 0;
  rep(i, 0, N){
    ans += (D - 1) / A[i] + 1;
  }
  cout << ans + X << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: expected primary-expression before ',' token
   23 |     int max = , min;
      |               ^
a.cc:26:16: error: 'max' cannot be used as a function
   26 |       max = max(A[j], max);
      |             ~~~^~~~~~~~~~~
a.cc:27:16: error: no matching function for call to 'min(int&, <unresolved overloaded function type>)'
   27 |       min = min(A[j], min);
      |             ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:36: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const int&'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |                         ~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:27:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   27 |       min = min(A[j], min);
      |             ~~~^~~~~~~~~~~
a.cc:29:25: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-'
   29 |     cout << 2 * abs(max - min) << endl;
      |                     ~~~~^~~~~
a.cc: At global scope:
a.cc:40:14: error: redefinition of 'const double PI'
   40 | const double PI = 3.14159265358979323846;
      |              ^~
a.cc:7:14: note: 'const double PI' previously defined here
    7 | const double PI = 3.14159265358979323846;
      |              ^~
a.cc:41:14: error: redefinition of 'const double EPS'
   41 | const double EPS = 1e-12;
      |              ^~~
a.cc:8:14: note: 'const double EPS' previously defined here
    8 | const double EPS = 1e-12;
      |              ^~~
a.cc:42:10: error: conflicting declaration 'const ll INF'
   42 | const ll INF = 1LL<<29;
      |          ^~~
a.cc:10:11: note: previous declaration as 'const int INF'
   10 | const int INF = 1e9;
      |           ^~~
a.cc:43:10: error: redefinition of 'const ll mod'
   43 | const ll mod = 1e9+7;
      |          ^~~
a.cc:11:10: note: 'const ll mod' previously defined here
   11 | const ll mod = 1e9+7;
      |          ^~~
a.cc:47:5: error: redefinition of 'int main()'
   47 | int main()
      |     ^~~~
a.cc:15:5: note: 'int main()' previously defined here
   15 | int main()
      |     ^~~~