using System;
using System.Collections.Generic;
using System.Numerics;
class Program
{
Scanner cin;
const long INF = 1000000000000000000L;
int N;
long[] S;
long[] ans;
void rec(int l, int r)
{
if(l >= r)
{
return;
}
int md = (l + r) / 2;
rec(l, md);
rec(md + 1, r);
if (l < md)
{
var cht = new Optimization.SimpleCHT();
for (long i = md + 1; i <= r; i++)
{
cht.AddLine(-2 * i, i * i + S[i]);
}
long ret = INF;
for (long i = l; i < md; i++)
{
ret = Math.Min(ret, cht.Query((int)i) + i * i - S[i]);
ans[i] = Math.Min(ans[i], ret);
}
}
if (md < r)
{
var cht = new Optimization.SimpleCHT();
for (long i = md; i >= l; i--)
{
cht.AddLine(2 * i, i * i - S[i]);
}
long ret = INF;
for (long i = r; i > md; i--)
{
ret = Math.Min(ret, cht.Query((int)-i) + i * i + S[i]);
ans[i - 1] = Math.Min(ans[i - 1], ret);
}
}
}
void myon()
{
cin = new Scanner();
N = cin.nextInt();
S = new long[N + 1];
for(int i = 0; i < N; i++)
{
S[i + 1] = S[i] + cin.nextLong();
}
ans = new long[N];
for(int i = 0; i < N; i++)
{
ans[i] = INF;
}
rec(0, N);
for(int i = 0; i < N; i++)
{
Console.WriteLine(ans[i]);
}
}
static void Main(string[] args)
{
new Program().myon();
}
}
class Scanner
{
string[] s;
int i;
readonly char[] cs = new char[] { ' ' };
public Scanner()
{
s = new string[0];
i = 0;
}
public string next()
{
if (i < s.Length) return s[i++];
string st = Console.ReadLine();
while (st == "") st = Console.ReadLine();
s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
if (s.Length == 0) return next();
i = 0;
return s[i++];
}
public string nextLine()
{
return Console.ReadLine();
}
public int nextInt()
{
return int.Parse(next());
}
public long nextLong()
{
return long.Parse(next());
}
public double nextDouble()
{
return double.Parse(next());
}
}
// https://yukicoder.me/submissions/109325
#region CHT
namespace Optimization
{
using N = System.Int64;
struct L
{
internal N a, b;
///
/// u*x+v
///
public L(N u, N v) : this() { a = u; b = v; }
///
/// F(x)=a*x+b
///
public N F(int x) { return a * x + b; }
}
///
/// 追加される直線の傾きが単調減少
///
public class SimpleCHT
{
int s, t;
List deq = new List();
///
/// ax+b を追加
/// aは単調減少でないとダメ,ならしO(1)
///
public void AddLine(N a, N b)
{
var l = new L(a, b);
while (s + 1 < t && check_fast(deq[t - 2], deq[t - 1], l)) { t--; deq.RemoveAt(t); }
deq.Add(l);
t++;
}
///
/// xが単調増加のときのみ使ってよい,ならしO(1)
///
public N Get(int x)
{
while (s + 1 < t && deq[s].F(x) >= deq[s + 1].F(x)) s++;
return deq[s].F(x);
}
///
/// xが単調増加でないときでも使える,O(logN)
///
///
///
public N Query(int x)
{
var l = s - 1; var h = t - 1;
while (l + 1 < h)
{
var m = (l + h) / 2;
if (isR_fast(deq[m], deq[m + 1], x)) l = m;
else h = m;
}
return deq[h].F(x);
}
///
/// ax,bが小さい
///
private bool isR_fast(L l1, L l2, int x)
{
return (l1.b - l2.b) >= x * (l2.a - l1.a);
}
///
/// ax,bが大きい
///
private bool isR_slow(L l1, L l2, int x)
{
BigInteger b1 = l1.b, b2 = l2.b;
BigInteger a1 = l1.a, a2 = l2.a;
return (b1 - b2) >= x * (a2 - a1);
}
///
/// a*bが小さい
///
private bool check_fast(L l1, L l2, L l3)
{
return (l2.a - l1.a) * (l3.b - l2.b) >= (l2.b - l1.b) * (l3.a - l2.a);
}
///
/// a*bが大きい
///
private bool check_slow(L l1, L l2, L l3)
{
BigInteger a1 = l1.a, a2 = l2.a, a3 = l3.a;
BigInteger b1 = l1.b, b2 = l2.b, b3 = l3.b;
return (a2 - a1) * (b3 - b2) >= (b2 - b1) * (a3 - a2);
}
}
}
#endregion