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 betw...
int main() { int n; scanf("%d",&n); for (int i = 1;i<=n;i++) scanf("%lld",&a[i]); a[0]=-INF; a[n+1]=INF; sort(a,a+n); for (int i = 1;i<=n;i++) printf("%lld %lld\n",min(a[i]-a[i-1],a[i+1]-a[i]),max(a[i]-a[1],a[n]-a[i])); }...
time limit per test memory limit per test input output Oxcoordinate axis. Thus, each city is associated with its positionxi— a coordinate on theOx 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 the...
A. Lineland Mail Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/567/problem/A Description All cities of Lineland are located on theOxcoordinate axis. Thus, each city is associated with its positionxi— a coordinate on theOxaxis. No two cities are located a...
Codeforce 567A - Lineland Mail All cities of Lineland are located on the Ox coordinate axis. Thus, each city is associated with its position xi— 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 ...
A. Lineland Mail Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/567/problem/A Description All cities of Lineland are located on theOxcoordinate axis. Thus, each city is associated with its positionxi— a coordinate on theOxaxis. No two cities are located at...
A. Lineland Mail Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/567/problem/A Description All cities of Lineland are located on theOxcoordinate axis. Thus, each city is associated with its positionxi— a coordinate on theOxaxis. No two cities are located ...