Language: C++

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

int n, a[MAXN];
bool flag; 
const int cnt = 5637, pri[] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 21$

bool query(register int o) {
        register int tmp = sqrt(o) + 1;
        for (register int i = 2; i <= tmp; ++i)
                if (!o % i) return 0;
        return 1;
}

void check() {
        for (register int o = 1; o <= n; ++o)
                for (register int p = o + 1; p <= n; ++p)
                        for (register int q = p + 1; q <= n; ++q)
                                for (register int r = q + 1; r <= n; ++r)
                                        for (register int s = r + 1; s <= n; ++s)
                                                if (!query(a[o] + a[p] + a[q] + a[r] + a[s])) return;
        flag = 1;
        return;
} 

void dfs(register int cur, register int lst) {
        if (cur == n + 1) {
                check();
                return;
        }
        for (register int i = lst + 1, i_lim = cnt - n + 1; i <= i_lim; ++i) {
                a[cur] = pri[i];
                dfs(cur + 1, i);
                if (flag) return;
        }
}

int main() {
        scanf("%d", &n);
        dfs(1, 0);
        for (register int i = 1; i <= n; ++i) 
                printf("%d ", a[i]);
        return 0;
}

Compiler output:
a.cc:7:236: error: unable to find numeric literal operator 'operator""$'
    7 | const int cnt = 5637, pri[] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 21$
      |                                                                                                                                                                                                                                            ^~~
a.cc:9:1: error: expected '}' before 'bool'
    9 | bool query(register int o) {
      | ^~~~
a.cc:7:31: note: to match this '{'
    7 | const int cnt = 5637, pri[] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 21$
      |                               ^
a.cc: In function 'void check()':
a.cc:17:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |         for (register int o = 1; o <= n; ++o)
      |                           ^
a.cc:18:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |                 for (register int p = o + 1; p <= n; ++p)
      |                                   ^
a.cc:19:43: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   19 |                         for (register int q = p + 1; q <= n; ++q)
      |                                           ^
a.cc:20:51: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   20 |                                 for (register int r = q + 1; r <= n; ++r)
      |                                                   ^
a.cc:21:59: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |                                         for (register int s = r + 1; s <= n; ++s)
      |                                                           ^
a.cc:22:54: error: 'query' was not declared in this scope
   22 |                                                 if (!query(a[o] + a[p] + a[q] + a[r] + a[s])) return;
      |                                                      ^~~~~
a.cc: At global scope:
a.cc:27:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   27 | void dfs(register int cur, register int lst) {
      |                       ^~~
a.cc:27:41: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   27 | void dfs(register int cur, register int lst) {
      |                                         ^~~
a.cc: In function 'void dfs(int, int)':
a.cc:32:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   32 |         for (register int i = lst + 1, i_lim = cnt - n + 1; i <= i_lim; ++i) {
      |                           ^
a.cc:32:40: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   32 |         for (register int i = lst + 1, i_lim = cnt - n + 1; i <= i_lim; ++i) {
      |                                        ^~~~~
a.cc: In function 'int main()':
a.cc:42:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   42 |         for (register int i = 1; i <= n; ++i)
      |                           ^