#include <bits/stdc++.h>
using namespace std;
int a[100005];
int b[100005];
int c[2000005];
int main() {
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
}
for (int i = 1; i <= n; i++) {
scanf("%d", &b[i]);
}
sort(a + 1, a + n + 1);
sort(b + 1, b + n + 1);
int p = 1;
for (int i = 1; i <= n; i++) {
for (int j = 1; i * j <= n; j++) {
c[p] = a[i] + b[j];
p++;
}
}
sort(c + 1, c + p);
for (int i = 1; i <= n; i++) {
printf("%d ", c[i] );
}
cout << endl;
return 0;
}
评论区