Codeforces Round #Pi (Div. 2)
A
Lineland Mail
Codeforces
900
原题
←B →
翻译中…

All cities of Lineland are located on the $*Ox*$ coordinate axis. Thus, each city is associated with its position $*x*_{*i*}$ — a coordinate on the $*Ox*$ axis. No two cities are located at a single point.

翻译中…

Lineland residents love to send letters to each other. A person may send a letter only if the recipient lives in another city (because if they live in the same city, then it is easier to drop in).

翻译中…

Strange but true, the cost of sending the letter is exactly equal to the distance between the sender's city and the recipient's city.

翻译中…

For each city calculate two values ​​$*min*_{*i*}$ and $*max*_{*i*}$, where $*min*_{*i*}$ is the minimum cost of sending a letter from the $*i*$-th city to some other city, and $*max*_{*i*}$ is the the maximum cost of sending a letter from the $*i*$-th city to some other city

翻译中…

Input

翻译中…

The first line of the input contains integer $*n*$ ($2 ≤ *n* ≤ 10^{5}$) — the number of cities in Lineland. The second line contains the sequence of $*n*$ distinct integers $*x*_{1}, *x*_{2}, ..., *x*_{*n*}$ ($- 10^{9} ≤ *x*_{*i*} ≤ 10^{9}$), where $*x*_{*i*}$ is the $*x*$-coordinate of the $*i*$-th city. All the $*x*_{*i*}$'s are distinct and follow in ascending order.

翻译中…

Output

翻译中…

Print $*n*$ lines, the $*i*$-th line must contain two integers $*min*_{*i*}, *max*_{*i*}$, separated by a space, where $*min*_{*i*}$ is the minimum cost of sending a letter from the $*i*$-th city, and $*max*_{*i*}$ is the maximum cost of sending a letter from the $*i*$-th city.

翻译中…

样例

Input #1
4
-5 -2 2 7
Output #1
3 12
3 9
4 7
5 12
InputCopy OutputCopy
Input #2
2
-1 1
Output #2
2 2
2 2
InputCopy OutputCopy
题目信息
题号
567A
时间限制
3 s
内存限制
256 MB
标签
贪心
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。