Language: C++

#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;

struct Node {
    ll d; int id;

    Node() {}
    Node(ll d, int x):d(d), id(x) {}

    friend bool operator < (Node a, Node b) { return a.d < b.d; }
}d[MAXN];

int sz[MAXN];
int u[MAXN];
int v[MAXN];

int main() {
    int n = ri;
    for(int i = 1; i <= n; i++) d[i] = Node(rl, i), sz[i] = 1;
    sort(d + 1, d + 1 + n);
    ll dis = 0, N = 0;
    for(int i = n; i > 1; i--) {
        ll D = d[i].d - n + (sz[i] << 1);
        int p = lower_bound(d + 1, d + 1 + n, Node(D, 0)) - d;
        if(d[p].d != D) return puts("-1"), 0;
        ++N;
        u[N] = d[i].id;
        v[N] = d[p].id;
        sz[p] += sz[i];
        dis += sz[i];
    }
    if(dis != d[1].d) puts("-1");
    else
        for(int i = 1; i <= N; i++)
            printf("%d %d\n", u[i], v[i]);
    return 0;
}
//无脑 

Compiler output:
a.cc:6:5: error: 'll' does not name a type
    6 |     ll d; int id;
      |     ^~
a.cc:9:12: error: expected ')' before 'd'
    9 |     Node(ll d, int x):d(d), id(x) {}
      |         ~  ^~
      |            )
a.cc: In function 'bool operator<(Node, Node)':
a.cc:11:56: error: 'struct Node' has no member named 'd'; did you mean 'id'?
   11 |     friend bool operator < (Node a, Node b) { return a.d < b.d; }
      |                                                        ^
      |                                                        id
a.cc:11:62: error: 'struct Node' has no member named 'd'; did you mean 'id'?
   11 |     friend bool operator < (Node a, Node b) { return a.d < b.d; }
      |                                                              ^
      |                                                              id
a.cc: In function 'int main()':
a.cc:19:13: error: 'ri' was not declared in this scope
   19 |     int n = ri;
      |             ^~
a.cc:20:45: error: 'rl' was not declared in this scope
   20 |     for(int i = 1; i <= n; i++) d[i] = Node(rl, i), sz[i] = 1;
      |                                             ^~
a.cc:22:5: error: 'll' was not declared in this scope
   22 |     ll dis = 0, N = 0;
      |     ^~
a.cc:24:11: error: expected ';' before 'D'
   24 |         ll D = d[i].d - n + (sz[i] << 1);
      |           ^~
      |           ;
a.cc:25:52: error: 'D' was not declared in this scope
   25 |         int p = lower_bound(d + 1, d + 1 + n, Node(D, 0)) - d;
      |                                                    ^
a.cc:26:17: error: 'struct Node' has no member named 'd'; did you mean 'id'?
   26 |         if(d[p].d != D) return puts("-1"), 0;
      |                 ^
      |                 id
a.cc:27:11: error: 'N' was not declared in this scope
   27 |         ++N;
      |           ^
a.cc:31:9: error: 'dis' was not declared in this scope; did you mean 'div'?
   31 |         dis += sz[i];
      |         ^~~
      |         div
a.cc:33:8: error: 'dis' was not declared in this scope; did you mean 'div'?
   33 |     if(dis != d[1].d) puts("-1");
      |        ^~~
      |        div
a.cc:33:20: error: 'struct Node' has no member named 'd'; did you mean 'id'?
   33 |     if(dis != d[1].d) puts("-1");
      |                    ^
      |                    id
a.cc:35:29: error: 'N' was not declared in this scope
   35 |         for(int i = 1; i <= N; i++)
      |                             ^