LIGHTIN - Lightning Conductor

题意翻译

Description 已知一个长度为n的序列a1,a2,…,an。 对于每个1<=i<=n,找到最小的非负整数p满足 对于任意的j, aj < = ai + p – sqrt(abs(i-j)) Input 第一行n,(1<=n<=500000) 下面每行一个整数,其中第i行是ai。(0<=ai<=1000000000) Output n行,第i行表示对于i,得到的p Sample Input 6 5 3 2 4 2 4 Sample Output 2 3 5 3 5 4 由 @枫林晚 提供翻译

题目描述

Progressive climate change has forced the Byteburg authorities to build a huge lightning conductor that would protect all the buildings within the city. These buildings form a row along a single street, and are numbered from ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/17e23bd9f4448274b895d37e159cb09751fdf2de.png) to ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/169265ff2535c9e3f13c7674d3e988cc0267cb40.png). The heights of the buildings and the lightning conductor are non-negative integers. Byteburg's limited funds allow construction of only a single lightning conductor. Moreover, as you would expect, the higher it will be, the more expensive. The lightning conductor of height ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/67c86636710472fd55153ecc9149909d188e69bd.png) located on the roof of the building ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/af121dc60b0f474c5ebf06392d630180cf0b86f7.png) (of height ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/cb6e11da1ecb979beea9b15972a6727ba1d2adaf.png)) protects the building ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/9abe23f8a6558829180116605bad3d08b1aa9c43.png) (of height ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/f199ed28b22b7088d85b510ea9863ae25ee78c48.png)) if the following inequality holds: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/1a406958d9cd57e472067c35e20b59b7556db88b.png) where ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/7cb601d9536bb3564d3928b6fc706600350d568f.png) denotes the absolute value of the difference between ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/af121dc60b0f474c5ebf06392d630180cf0b86f7.png) and ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/9abe23f8a6558829180116605bad3d08b1aa9c43.png). Byteasar, the mayor of Byteburg, asks your help. Write a program that, for every building ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/af121dc60b0f474c5ebf06392d630180cf0b86f7.png), determines the minimum height of a lightning conductor that would protect all the buildings if it were put on top of the building ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/af121dc60b0f474c5ebf06392d630180cf0b86f7.png). Input ----- In the first line of the standard input there is a single integer ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/169265ff2535c9e3f13c7674d3e988cc0267cb40.png) (![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/189daf92c94d3bb53ae2da1a16af4dcdf098edba.png)) that denotes the number of buildings in Byteburg. Each of the following ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/169265ff2535c9e3f13c7674d3e988cc0267cb40.png) lines holds a single integer ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/cb6e11da1ecb979beea9b15972a6727ba1d2adaf.png) (![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/6dbdc8ddc0dbe8431e503a25359fbedb291fa0f3.png)) that denotes the height of the ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/af121dc60b0f474c5ebf06392d630180cf0b86f7.png)-th building. Output ------ Your program should print out exactly ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/169265ff2535c9e3f13c7674d3e988cc0267cb40.png) lines to the standard output. The ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/af121dc60b0f474c5ebf06392d630180cf0b86f7.png)-th line should give a non-negative integer ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/b8d6419fb1914bbda9deeabc8c8eeca40e117c89.png) denoting the minimum height of the lightning conductor on the ![](https://cdn.luogu.com.cn/upload/vjudge_pic/SP9070/af121dc60b0f474c5ebf06392d630180cf0b86f7.png)-th building. Example ------- For the input data: ``` 6 5 3 2 4 2 4 ``` the correct result is: ``` 2 3 5 3 5 4 ```

输入输出格式

输入格式


输出格式


输入输出样例

暂无测试点