Language: C++

#include <iostream>
#include <vector>

using namespace std;

constexpr uint64_t kMod = 1'000'000'000 + 7;

template<class T>
vector<vector<T>> ScanVectors(uint64_t all_size, uint64_t vec_size) {
  vector<vector<T>> vectors(all_size);
  for (uint64_t i = 0; i < all_size; i++) {
    for (uint64_t j = 0; j < vec_size; j++) {
      T in; cin >> in; vectors[j].emplace_back(in);
    }
  }
  return vectors;
}

uint64_t gcd(uint64_t a, uint64_t b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }

  return b ? gcd(b, a % b) : a;
}

uint64_t lcm(uint64_t a, uint64_t b) {
  return a * b / gcd(a, b);
}

////////////////////////////////////////////////////////////////////////////////

int main() {
  uint64_t N;
  cin >> N;

  auto A = ScanVectors<uint64_t>(N, 1)[0];
  sort(A.rbegin(), A.rend());

  if (A.size() == 1) {
    cout << 1 << endl;
    return 0;
  }

  uint64_t result = 0;
  uint64_t lll = lcm(A[0], A[1]);
  for (size_t i = 2; i < N; i++) {
    lll = lcm(lll, A[i]);
  }

  for (uint64_t i = 0; i < N; i++) {
    result = (result + (lll / A[i])) % kMod;
  }

  cout << result << endl;

  return 0;
}


Compiler output:
a.cc:6:11: error: 'uint64_t' does not name a type
    6 | constexpr uint64_t kMod = 1'000'000'000 + 7;
      |           ^~~~~~~~
a.cc:3:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include <vector>
  +++ |+#include <cstdint>
    3 | 
a.cc:9:31: error: 'uint64_t' was not declared in this scope
    9 | vector<vector<T>> ScanVectors(uint64_t all_size, uint64_t vec_size) {
      |                               ^~~~~~~~
a.cc:9:31: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:9:50: error: 'uint64_t' was not declared in this scope
    9 | vector<vector<T>> ScanVectors(uint64_t all_size, uint64_t vec_size) {
      |                                                  ^~~~~~~~
a.cc:9:50: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:9:68: error: expected ';' before '{' token
    9 | vector<vector<T>> ScanVectors(uint64_t all_size, uint64_t vec_size) {
      |                                                                    ^~
      |                                                                    ;
a.cc:19:1: error: 'uint64_t' does not name a type
   19 | uint64_t gcd(uint64_t a, uint64_t b) {
      | ^~~~~~~~
a.cc:19:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:29:1: error: 'uint64_t' does not name a type
   29 | uint64_t lcm(uint64_t a, uint64_t b) {
      | ^~~~~~~~
a.cc:29:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc: In function 'int main()':
a.cc:36:3: error: 'uint64_t' was not declared in this scope
   36 |   uint64_t N;
      |   ^~~~~~~~
a.cc:36:3: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:37:10: error: 'N' was not declared in this scope
   37 |   cin >> N;
      |          ^
a.cc:40:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   40 |   sort(A.rbegin(), A.rend());
      |   ^~~~
      |   short
a.cc:47:11: error: expected ';' before 'result'
   47 |   uint64_t result = 0;
      |           ^~~~~~~
      |           ;
a.cc:48:11: error: expected ';' before 'lll'
   48 |   uint64_t lll = lcm(A[0], A[1]);
      |           ^~~~
      |           ;
a.cc:50:5: error: 'lll' was not declared in this scope
   50 |     lll = lcm(lll, A[i]);
      |     ^~~
a.cc:50:11: error: 'lcm' was not declared in this scope
   50 |     lll = lcm(lll, A[i]);
      |           ^~~
a.cc:53:16: error: expected ';' before 'i'
   53 |   for (uint64_t i = 0; i < N; i++) {
      |                ^~
      |                ;
a.cc:53:24: error: 'i' was not declared in this scope
   53 |   for (uint64_t i = 0; i < N; i++) {
      |                        ^
a.cc:54:5: error: 'result' was not declared in this scope
   54 |     result = (result + (lll / A[i])) % kMod;
      |     ^~~~~~
a.cc:54:25: error: 'lll' was not declared in this scope
   54 |     result = (result + (lll / A[i])) % kMod;
      |                         ^~~
a.cc:54:40: error: 'kMod' was not declared in this scope
   54 |     result = (result + (lll / A[i])) % kMod;
      |                                        ^~~~
a.cc:57:11: error: 'result' was not declared in this scope
   57 |   cout << result << endl;
      |           ^~~~~~