#include<bits/stdc++.h>
#define int long long
#define N 200015
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define inf 0x3f3f3f3f
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define fi first
#define se second
#define lowbit(i) ((i)&(-i))
#define VI vector<int>
#define all(x) x.begin(),x.end()
#define SZ(x) ((int)x.size())
using namespace std;
int n,a[N];
signed main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	scanf("%lld",&n);
	rep(i,1,n) scanf("%lld",&a[i]);
	int Max = 0,sum = 0,res = 0;
	rep(i,1,n){
		Max = max(Max,a[i]);
		sum += a[i];
		res += sum;
		printf("%lld\n",1ll*i*Max+res);
	}
	return 0;
}
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define ld long double
#define el '\n'
#define bizarre  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ordered_set tree<pair<int, int> , null_type,less<pair<int, int> >, rb_tree_tag,tree_order_statistics_node_update>
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
using namespace std;
void err(istream_iterator<string> it) {cerr << endl;}
template<typename T, typename... Args>void err(istream_iterator<string> it, T a, Args... args) {cerr << *it << " = " << a << endl;err(++it, args...);}
const ll N = 500 + 5,mod = 1e9 + 7, inf = 1e18;

int main() {
    bizarre
    int t = 1;
    //cin >> t;
    while (t--) {
        int n,w;
        cin >> n >> w;
        cout << n/w;
    }
    return 0;
}