#include <iostream>
#include <vector>
#include <math.h>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
int main()
{
int64_t default_min = 1'000'000'000;
int64_t n;
cin >> n;
vector<int64_t> city(n);
vector<int64_t> min(n, default_min);
vector<int64_t> max(n, 0);
for (auto& i : city)
{
cin >> i;
}
for (int i = 0; i < n; i++) {//max
if (i != 0 || i != n - 1) {
if (signed int(city[i] - city[i-1]) >= signed int(city[i+1] - city[i]))
{
max[i] = abs(city[i] - city[i - 1]);
min[i] = abs(city[i] - city[i + 1]);
}
else {
min[i] = abs(city[i] - city[i - 1]);
max[i] = abs(city[i] - city[i + 1]);
}
}
else if (i == 0) {
min[i] = city[1] - city[0];
max[i] = city[n-1] - city[0];
}
else if (i == n-1) {
min[i] = city[n-1] - city[n-2];
max[i] = max[0];
}
}
for (int i=0;i<n;i++)
{
cout << min[i] << " " << max[i]<<endl;
}
}
i tried in the comparison line to cast it as unsigned or signed on both sides but it didn't work ,i reached this point because so far i couldn't find other way to compare values inside vectors easily.. so is there way to avoid the mismatch /match error by either casting or comparing vectors in more efficient way