Language: C++

#include <bits/stdc++.h>                                                                                                                                                                            using namespace std;                                                                                                                                                                                int dp[201][201];                                                                                                                                                                                                                                                                                     void build() {
    for (int i=1; i<=200; i++)                                                                            for (int j=i+1; j<=199; j++)                                                                              dp[i][j] = __gcd(i,j);
}
                                                                                                                                                                                                    int main() {
                                                                                                      int k;                                                                                            cin >> k;
    long ans = 0;                                                                                     for (int i=1; i<=k; i++)
        for (int j=1; j<=k; j++)                                                                              for (int h=1; h<=k; h++) {
                int a = i;                                                                                        int b = j;
                int c = h;

                int x = dp[max(a,b)][min(a,b)];                                                                   int y = dp[max(x,c)][min(x,c)];                                                                                                                                                                     ans = ans + y;
            }
    cout << ans << endl;                                                                          }                                                             

Compiler output:
a.cc:1:197: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>                                                                                                                                                                            using namespace std;                                                                                                                                                                                int dp[201][201];                                                                                                                                                                                                                                                                                     void build() {
      |                                                                                                                                                                                                     ^~~~~
a.cc:1:5: error: expected unqualified-id before 'for'
    1 | #include <bits/stdc++.h>                                                                                                                                                                            using namespace std;                                                                                                                                                                                int dp[201][201];                                                                                                                                                                                                                                                                                     void build() {
      |     ^~~
a.cc:1:19: error: 'i' does not name a type
    1 | #include <bits/stdc++.h>                                                                                                                                                                            using namespace std;                                                                                                                                                                                int dp[201][201];                                                                                                                                                                                                                                                                                     void build() {
      |                   ^
a.cc:1:27: error: 'i' does not name a type
    1 | #include <bits/stdc++.h>                                                                                                                                                                            using namespace std;                                                                                                                                                                                int dp[201][201];                                                                                                                                                                                                                                                                                     void build() {
      |                           ^
a.cc:1:123: error: 'j' does not name a type
    1 | #include <bits/stdc++.h>                                                                                                                                                                            using namespace std;                                                                                                                                                                                int dp[201][201];                                                                                                                                                                                                                                                                                     void build() {
      |                                                                                                                           ^
a.cc:1:131: error: 'j' does not name a type
    1 | #include <bits/stdc++.h>                                                                                                                                                                            using namespace std;                                                                                                                                                                                int dp[201][201];                                                                                                                                                                                                                                                                                     void build() {
      |                                                                                                                                   ^
a.cc:2:1: error: expected declaration before '}' token
    2 |     for (int i=1; i<=200; i++)                                                                            for (int j=i+1; j<=199; j++)                                                                              dp[i][j] = __gcd(i,j);
      | ^
a.cc: In function 'int main()':
a.cc:4:201: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |                                                                                                                                                                                                     int main() {
      |                                                                                                                                                                                                         ^~~
      |                                                                                                                                                                                                         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:25: error: 'dp' was not declared in this scope; did you mean 'dup'?
   10 | 
      |                         ^ 
      |                         dup
a.cc:10:28: error: 'max' was not declared in this scope; did you mean 'std::max'?
   10 | 
      |                            ^  
      |                            std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:10:38: error: 'min' was not declared in this scope; did you mean 'std::min'?
   10 | 
      |                                      ^  
      |                                      std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |             }
      |     ^   
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |             }
      |                    ^   
      |                    std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~