stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<string>

using namespace std;



int main()

{

    char c[5];

    int A, B, count = 0;

    cin >> A >> B;

    for (int i = A; i <= B; i++)

    {

        string s = to_string(i);

        if (s[0] == s[4] && s[1] == s[3])

        {

            count++;

        }

    }

    

    cout << count << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 9.98746681565971x):
#include<stdio.h>



int main()

{

    int A, B;

    scanf("%d%d", &A, &B);

    int x = 0;

    for (int i = A; i <= B; i++)

    {

        int s = i % 10;

        int t = i / 10000 % 10;

        int u = i / 10 % 10;

        int v = i / 1000 % 10;

        if (s == t && u == v) x++;

    }

    printf("%d\n", x);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

bool ok(int a)

{

   int n=0;

   int aa=a;

   while(aa)

   {

      n = n*10 + aa%10;

      aa/=10;

   }

   return a==n;

}

int main()

{

   int a,b,i,j,cnt=0;

   cin>>a>>b;

   for(i=a;i<=b;i++)

   {

      if(ok(i))cnt++;

   }

   cout<<cnt<<endl;

   return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.056365090460602x):
#include<stdio.h>

#include<math.h>

#include<string.h> 

int main() {

	int a,b;

	scanf("%d %d",&a,&b);

	int i,j;

	int cnt=0;

	for(i=a;i<=b;i++){

		int c,d,e,f,g;

		c=i/10000;

		d=i%10000/1000;

		e=i%1000/100;

		f=i%100/10;

		g=i%10;

		if(c==g&&d==f){

			cnt++;

		}

	}

	printf("%d",cnt);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/numeric>

using namespace std;

using namespace __gnu_cxx;

#define write_to_file() freopen("output.txt" , "w" , stdout)

#define read_from_file() freopen("input.txt" , "r" , stdin)

#define GeoOutputFix(VV) cout<<fixed<<setprecision(VV)

#define MAX_V  1e9

#define MIN_V -1e9

template<class T>istream& operator>> (istream& is, complex<T>& p){T value;is >> value, p.real(value), is >> value, p.imag(value);return is;}

typedef long long lld;

typedef pair<lld, lld> dd;

typedef complex<double> point;

#define X real()

#define Y imag()

#define dist(a , b) sqrt(pow(a.X - b.X , 2) + pow(a.Y- b.Y , 2))

#define dist2(a , b) ((long double)hypot(a , b))

#define mid(a,b) (((a)+(b))/point(2,0))

#define compare(a , b) (fabs(a.X - b.X) < -1e9 && fabs(a.Y - b.Y) < -1e9)

#define all(c) c.begin() , c.end()

#define MOD (lld)(1e9+7)

#define EPS 1e-9

#define neighbours(u , e , v) for(int e = head[u] , v ; v = to[e] , ~e ; e = nxt[e])

#define watch1(x) cout<<(#x)<<" = "<<x<<"\n"

#define watch2(x , y) cout<<(#x)<<" = "<<x<<"  "<<(#y)<<" = "<<(y)<<"\n"

#define watch3(x , y , z) cout<<(#x)<<" = "<<x<<"  "<<(#y)<<" = "<<(y)<"  "<<(#z)<<" = "<<(z)<<"\n"

int dr[] = {1 , 1 , 1 , 0 , 0 , -1 , -1 , -1};

int dc[] = {-1 , 0 , 1 , -1 , 1 , -1 , 0 , 1};

int ddr[] = {1 , 0 , 0 , -1};

int ddc[] = {0 , -1 , 1 , 0};

inline int SD(){int i ;scanf("%d", &i);return i;}

inline lld SLL(){lld i;scanf("%lld", &i);return i;}

inline char SC(){char i;scanf(" %c", &i);return i;}

const int AKA = 1e6 + 6 , OO = 0x3f3f3f3f;

//----------------------------------------[TO_OO]--[To infinity and beyond]--------------------------------------------------------

bool ispal(int x)

{

    vector<int> v;

    while(x)

    {

        v.push_back(x % 10);

        x /= 10;

    }

    int n = v.size();

    for(int i = 0 ; i < n / 2 ; ++i)

        if(v[i] != v[n - i - 1])

            return false;

    return true;

}

int main()

{

    int a = SD() , b = SD() , ans = 0;

    for(int i = a ; i <= b ; ++i)

        ans += ispal(i);

    printf("%d" , ans);

}


// Faster C++ solution for the same problem (measured speedup: 11.605449489376591x):
#include<stdio.h>

#include<math.h>

#include<string.h> 

int main() {

	int a,b;

	scanf("%d %d",&a,&b);

	int i,j;

	int cnt=0;

	for(i=a;i<=b;i++){

		int c,d,e,f,g;

		c=i/10000;

		d=i%10000/1000;

		e=i%1000/100;

		f=i%100/10;

		g=i%10;

		if(c==g&&d==f){

			cnt++;

		}

	}

	printf("%d",cnt);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std ;



string  a , b ;



int main()

{

	cin >> a >> b ;

	int x = stoi(a);

	int y = stoi(b);

	int counter =0;

		

	for ( int i=x ; i<=y ; ++i)

		if ( (i%10) == (i/10000) &&  (i%100)/10 == (i/1000)%10 )

			counter++;

	

	cout << counter ;

	

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.6207893943029115x):
#include<stdio.h>

#include<math.h>

#include<string.h> 

int main() {

	int a,b;

	scanf("%d %d",&a,&b);

	int i,j;

	int cnt=0;

	for(i=a;i<=b;i++){

		int c,d,e,f,g;

		c=i/10000;

		d=i%10000/1000;

		e=i%1000/100;

		f=i%100/10;

		g=i%10;

		if(c==g&&d==f){

			cnt++;

		}

	}

	printf("%d",cnt);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define MXN 100005



int a[MXN];



int main() { 

    int n, res = 0;

    while (cin >> n) {

        memset(a, 0, sizeof(a));

        for (int i = 1; i <= n; ++i) {

            cin >> a[i];

            res += abs(a[i]-a[i-1]);

        }

        res += abs(a[n]);

        for (int i = 1; i <= n; ++i) {

            cout << res-abs(a[i]-a[i-1])-abs(a[i]-a[i+1])+abs(a[i-1]-a[i+1]) << "\n";

        }

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3832489171710307x):
#include <bits/stdc++.h>



using namespace std;



int main() {

    ios_base::sync_with_stdio(0);

    cin.tie(0);



    int n, sum = 0;

    cin >> n;

    int arr[n + 2];

    arr[0] = arr[n + 1] = 0;



    for (int i = 1; i <= n; i++)

        cin >> arr[i], sum += abs(arr[i] - arr[i - 1]);

    sum += abs(0 - arr[n]);



    for (int i = 1; i <= n; i++) {

        int diff = abs(arr[i] - arr[i - 1]) + abs(arr[i + 1] - arr[i]) - abs(arr[i + 1] - arr[i - 1]);

        cout << sum - diff << '\n';

    }



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define MXN 100005



int a[MXN];



int main() { 

    int n, res = 0;

    while (cin >> n) {

        memset(a, 0, sizeof(a));

        for (int i = 1; i <= n; ++i) {

            cin >> a[i];

            res += abs(a[i]-a[i-1]);

        }

        res += abs(a[n]);

        for (int i = 1; i <= n; ++i) {

            cout << res-abs(a[i]-a[i-1])-abs(a[i]-a[i+1])+abs(a[i-1]-a[i+1]) << "\n";

        }

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.401146177434279x):
#include<iostream>

using namespace std;

int a[100010];

int main()

{

	int n;

	cin>>n;

	a[0]=0;

	a[n+1]=0;

	int sum=0;

	for(int i=1;i<=n;i++)

	{

		cin>>a[i];

		sum+=abs(a[i]-a[i-1]);

	}

	sum+=abs(a[n+1]-a[n]);

	for(int i=1;i<=n;i++)

	{

		cout<<sum-abs(a[i-1]-a[i])-abs(a[i+1]-a[i])+abs(a[i+1]-a[i-1])<<endl;

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define MXN 100005



int a[MXN];



int main() { 

    int n, res = 0;

    while (cin >> n) {

        memset(a, 0, sizeof(a));

        for (int i = 1; i <= n; ++i) {

            cin >> a[i];

            res += abs(a[i]-a[i-1]);

        }

        res += abs(a[n]);

        for (int i = 1; i <= n; ++i) {

            cout << res-abs(a[i]-a[i-1])-abs(a[i]-a[i+1])+abs(a[i-1]-a[i+1]) << "\n";

        }

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3697074422106805x):
#include <bits/stdc++.h>



#define fi first

#define se second

#define ll long long



using namespace std;



const int N = 3e5 + 7;

const int mod = 1e9 + 7;



void solve1()

{

    int n;

    cin >> n;

    vector < int > v(n + 2 , 0);

    for( int i = 1; i <= n; i++ ){

        cin >> v[i];

    }

    int sum = 0;

    for( int i = 1; i <= n; i++ ){

        sum = sum + abs(v[i] - v[i - 1]);

    }

    sum += abs(v[n]);

    for( int i = 1; i < n; i++ ){

        cout << sum - abs(v[i] - v[i - 1]) - abs(v[i] - v[i + 1]) + abs(v[i - 1] - v[i + 1]) << "\n";

    }

    cout << sum - abs(v[n]) + abs(v[n - 1]) - abs(v[n] - v[n - 1]);

}



int main()

{

    ios_base::sync_with_stdio(0);

    cin.tie(0); cout.tie(0); srand(time(0));

    //freopen( "input.txt" , "r" , stdin );

    //freopen( "output.txt" , "w" , stdout );



    int cghf = 1;//cin >> cghf;

    while( cghf-- ){

        solve1();

    }

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define MXN 100005



int a[MXN];



int main() { 

    int n, res = 0;

    while (cin >> n) {

        memset(a, 0, sizeof(a));

        for (int i = 1; i <= n; ++i) {

            cin >> a[i];

            res += abs(a[i]-a[i-1]);

        }

        res += abs(a[n]);

        for (int i = 1; i <= n; ++i) {

            cout << res-abs(a[i]-a[i-1])-abs(a[i]-a[i+1])+abs(a[i-1]-a[i+1]) << "\n";

        }

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.4016717001571255x):
# include <bits/stdc++.h>

# define fi first

# define se second



using namespace std ;



long long N, vc[1000000] ;

long long sum, x;



int main() {

    cin >> N ;

    for( int i = 1 ; i <= N ; i ++ ) {

        cin >> vc[i] ;

        sum += abs(vc[i]-vc[i-1]) ;

    }

    sum += abs(vc[N]-0) ;

    for( int i = 1 ; i <= N ; i ++ ) {

        x = sum ;

        x -= abs( vc[i]-vc[i-1] ) ;

        x -= abs( vc[i]-vc[i+1] ) ;

        x += abs( vc[i-1] - vc[i+1] ) ;

        cout << x << endl;

    }

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define MXN 100005



int a[MXN];



int main() { 

    int n, res = 0;

    while (cin >> n) {

        memset(a, 0, sizeof(a));

        for (int i = 1; i <= n; ++i) {

            cin >> a[i];

            res += abs(a[i]-a[i-1]);

        }

        res += abs(a[n]);

        for (int i = 1; i <= n; ++i) {

            cout << res-abs(a[i]-a[i-1])-abs(a[i]-a[i+1])+abs(a[i-1]-a[i+1]) << "\n";

        }

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.4073063786370825x):
#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>



using namespace std;



typedef long long LL;



const int N = 100010;



int a[N], n;



int main()

{

    LL sum = 0;

    scanf("%d", &n);

    for(int i = 1; i <= n + 1; i ++)

    {

        scanf("%d", &a[i]);

        sum += abs(a[i] - a[i - 1]);

    }

    

    for(int i = 1; i <= n; i ++)

    {

        LL t = sum;

        if(a[i] > a[i - 1] && a[i] > a[i + 1] || a[i] < a[i - 1] && a[i] < a[i + 1])

        {

            t -= abs(a[i] - a[i - 1]) + abs(a[i] - a[i + 1]);

            t += abs(a[i + 1] - a[i - 1]);

        }

        printf("%lld\n", t);

    }

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstring>

#include<iostream>

#include<cmath>

using namespace std;

const int maxn=1e5+1;

int main()

{

    int val[maxn];

    int n;

    long long cost;

    while(~scanf("%d",&n)){

        memset(val,0,sizeof(val));

        cost=0;

        for(int i=1;i<=n;i++){

            scanf("%d",&val[i]);

            //cout<<'#'<<val[i]<<'#'<<endl;

            if(i==n) cost+=fabs(val[i]);

            cost+=fabs(val[i]-val[i-1]);

            //cout<<'@'<<cost<<'@'<<endl;

        }

        long long out;

        for(int i=1;i<=n;i++){

            if(i==n) out=cost-fabs(val[i])+fabs(val[i-1])-fabs(val[i]-val[i+1]);

            out=cost-fabs(val[i]-val[i-1])-fabs(val[i+1]-val[i])+fabs(val[i+1]-val[i-1]);

            printf("%lld\n",out);

        }

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.401735495725239x):
#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>



using namespace std;



typedef long long LL;



const int N = 100010;



int a[N], n;



int main()

{

    LL sum = 0;

    scanf("%d", &n);

    for(int i = 1; i <= n + 1; i ++)

    {

        scanf("%d", &a[i]);

        sum += abs(a[i] - a[i - 1]);

    }

    

    for(int i = 1; i <= n; i ++)

    {

        LL t = sum;

        if(a[i] > a[i - 1] && a[i] > a[i + 1] || a[i] < a[i - 1] && a[i] < a[i + 1])

        {

            t -= abs(a[i] - a[i - 1]) + abs(a[i] - a[i + 1]);

            t += abs(a[i + 1] - a[i - 1]);

        }

        printf("%lld\n", t);

    }

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define MXN 100005



int a[MXN];



int main() { 

    int n, res = 0;

    while (cin >> n) {

        memset(a, 0, sizeof(a));

        for (int i = 1; i <= n; ++i) {

            cin >> a[i];

            res += abs(a[i]-a[i-1]);

        }

        res += abs(a[n]);

        for (int i = 1; i <= n; ++i) {

            cout << res-abs(a[i]-a[i-1])-abs(a[i]-a[i+1])+abs(a[i-1]-a[i+1]) << "\n";

        }

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.4184302667601874x):
#include<iostream>

#include<string.h>

#include<math.h>

using namespace std;

int a[100005];

int b[100005];

int main()

{

	int i,n,sum=0;

	scanf("%d",&n);

	a[0]=0;

	a[n+1]=0;

	for(i=1;i<=n;i++)

	{

		scanf("%d",&a[i]);

		b[i]=abs(a[i]-a[i-1]);

		sum+=b[i];

	}

	b[n+1]=abs(a[n+1]-a[n]);

	sum+=b[n+1];

	for(i=1;i<=n;i++)

	{

		printf("%d\n",sum-b[i]-b[i+1]+abs(a[i+1]-a[i-1]));

	}

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstring>

#include<iostream>

#include<cmath>

using namespace std;

const int maxn=1e5+1;

int main()

{

    int val[maxn];

    int n;

    long long cost;

    while(~scanf("%d",&n)){

        memset(val,0,sizeof(val));

        cost=0;

        for(int i=1;i<=n;i++){

            scanf("%d",&val[i]);

            //cout<<'#'<<val[i]<<'#'<<endl;

            if(i==n) cost+=fabs(val[i]);

            cost+=fabs(val[i]-val[i-1]);

            //cout<<'@'<<cost<<'@'<<endl;

        }

        long long out;

        for(int i=1;i<=n;i++){

            if(i==n) out=cost-fabs(val[i])+fabs(val[i-1])-fabs(val[i]-val[i+1]);

            out=cost-fabs(val[i]-val[i-1])-fabs(val[i+1]-val[i])+fabs(val[i+1]-val[i-1]);

            printf("%lld\n",out);

        }

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.412815349458108x):
#include<iostream>

#include<string.h>

#include<math.h>

using namespace std;

int a[100005];

int b[100005];

int main()

{

	int i,n,sum=0;

	scanf("%d",&n);

	a[0]=0;

	a[n+1]=0;

	for(i=1;i<=n;i++)

	{

		scanf("%d",&a[i]);

		b[i]=abs(a[i]-a[i-1]);

		sum+=b[i];

	}

	b[n+1]=abs(a[n+1]-a[n]);

	sum+=b[n+1];

	for(i=1;i<=n;i++)

	{

		printf("%d\n",sum-b[i]-b[i+1]+abs(a[i+1]-a[i-1]));

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

#include<map>

#include<set>

#include<queue>

#define ll long long

using namespace std;

int pos(int n)

{

    if(n<0)

        return 0;

    else

        return n;

}

int main()

{

    int a[100002][2]= {0};

    int n;

    cin>>n;

    ll sum=0;

    for(int i=1; i<=n; i++)

    {

        scanf("%d",&a[i][0]);

 

        sum+=abs(a[i-1][0]-a[i][0]);

    }

    sum+=abs(a[n][0]);

    for(int i=1; i<=n; i++)

    {

 

            cout<<sum-abs(a[i][0]-a[i+1][0])-abs(a[i][0]-a[i-1][0])+abs(a[i-1][0]-a[i+1][0])<<endl;

 

  

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.8132909853453378x):
#include <iostream>

using namespace std;

#include <set>

#include <algorithm>

typedef long long ll;

const int N = 1e5+10;

int a[N];

int main()

{

	int n;

	cin >> n;

	

	for(int i = 1;i<=n;i++)

	{

		cin >> a[i];

	}

	ll sum = abs(a[1]-0);

	

	for(int i = 2;i<=n;i++)

	{

		sum +=abs(a[i]-a[i-1]);

	}

	

	sum+=abs(a[n]-0);

	

//	cout << sum << endl;

	for(int i = 1; i < n;i++)

	{

		ll res = sum - abs(a[i]-a[i-1])- abs(a[i+1]-a[i]) + abs(a[i+1]-a[i-1]);

		cout << res << endl;

	}

	

	cout << sum - abs(a[n]-a[n-1]) - abs(a[n]) + abs(a[n-1]);

	

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

#include<map>

#include<set>

#include<queue>

#define ll long long

using namespace std;

int pos(int n)

{

    if(n<0)

        return 0;

    else

        return n;

}

int main()

{

    int a[100002][2]= {0};

    int n;

    cin>>n;

    ll sum=0;

    for(int i=1; i<=n; i++)

    {

        scanf("%d",&a[i][0]);

 

        sum+=abs(a[i-1][0]-a[i][0]);

    }

    sum+=abs(a[n][0]);

    for(int i=1; i<=n; i++)

    {

 

            cout<<sum-abs(a[i][0]-a[i+1][0])-abs(a[i][0]-a[i-1][0])+abs(a[i-1][0]-a[i+1][0])<<endl;

 

  

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.8125999835723812x):
#include<bits/stdc++.h>



using namespace std;



const int maxn = 1e5 +  5;



int a[maxn];



int main()

{

   int n;

   cin >> n;

   int ans = 0;

   for(int i=1;i<=n;i++)

   {

       cin >> a[i];

       ans += abs(a[i] - a[i-1]);

   }

   ans += abs(a[n]);

   for(int i=1;i<=n;i++)

   {

       cout << ans - abs(a[i] - a[i-1]) - abs(a[i+1] - a[i]) + abs(a[i-1] - a[i+1]) << endl;

   }

   return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

#include<map>

#include<set>

#include<queue>

#define ll long long

using namespace std;

int pos(int n)

{

    if(n<0)

        return 0;

    else

        return n;

}

int main()

{

    int a[100002][2]= {0};

    int n;

    cin>>n;

    ll sum=0;

    for(int i=1; i<=n; i++)

    {

        scanf("%d",&a[i][0]);

 

        sum+=abs(a[i-1][0]-a[i][0]);

    }

    sum+=abs(a[n][0]);

    for(int i=1; i<=n; i++)

    {

 

            cout<<sum-abs(a[i][0]-a[i+1][0])-abs(a[i][0]-a[i-1][0])+abs(a[i-1][0]-a[i+1][0])<<endl;

 

  

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.8121129514286511x):
#include<iostream>

using namespace std;

typedef long long ll;

ll num[100005];

int main(){

	ll N,t=0;

	cin>>N;

	ll sum=0;

	for(int i=0;i<N;i++){

		cin>>num[i];

		sum=sum+abs(num[i]-t);

		t=num[i];

	}

	//下面开始丢弃数据

	for(int i=0;i<N;i++){

		int ans=sum;

		if(i!=0||i!=N-1){

			ans=ans-abs(num[i]-num[i-1])-abs(num[i+1]-num[i])+abs(num[i+1]-num[i-1])+abs(num[N-1]-0);

		}else if(i==0){

			ans=ans-abs(num[i]-0)-abs(num[i+1]-num[i])+abs(num[i+1]-0)+abs(num[N-1]-0);

		}else{

			ans=ans-abs(num[i]-num[i-1])+abs(num[i-1]-0);

		}

		cout<<ans<<endl;

	} 

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

#include<map>

#include<set>

#include<queue>

#define ll long long

using namespace std;

int pos(int n)

{

    if(n<0)

        return 0;

    else

        return n;

}

int main()

{

    int a[100002][2]= {0};

    int n;

    cin>>n;

    ll sum=0;

    for(int i=1; i<=n; i++)

    {

        scanf("%d",&a[i][0]);

 

        sum+=abs(a[i-1][0]-a[i][0]);

    }

    sum+=abs(a[n][0]);

    for(int i=1; i<=n; i++)

    {

 

            cout<<sum-abs(a[i][0]-a[i+1][0])-abs(a[i][0]-a[i-1][0])+abs(a[i-1][0]-a[i+1][0])<<endl;

 

  

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.8157563314485172x):
#include<iostream>

#include<fstream>

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<vector>

#include<set>

#include<list>

#include<queue>

#include<deque>

#include<unordered_map>

#include<map>

#include<string>

#include<cstring>

#include<stack>

#include<cmath>

#include<utility>



#define vint vector<int>

#define vstr vector<string>

#define vll vector<long long>

#define ll long long

#define pf printf

#define sf scanf

#define sfd(n) scanf("%d", &n)

#define sflf(n) scanf("%lf", &n)

#define sfll(n) scanf("%lld", &n)

#define pfd(n) printf("%d", n)

#define pflf(n) printf("%lf", n)

#define pfll(n) printf("%lld", n)

#define pft	printf("\t")

#define pfn printf("\n")

#define pfk printf(" ")

#define PI 3.1415926

#define MAX 100000

#define M 1e9



using namespace std;



int main() {

	int n;

	sfd(n);

	int* num = new int[n+2];

	vector<int> travel;

	num[0] = 0;

	int sum = 0, m;

	for( int i=1; i<=n; i++ ) {

		sfd(num[i]);

		m = abs(num[i]-num[i-1]);

		travel.push_back(m);

		sum += m;

	}

	num[n+1] = 0;

	sum += abs(num[n]);

	travel.push_back(abs(num[n]));

//	cout << "len = " << travel.size() << endl;

	for( int i=0; i<n; i++ ) {

		pfd(sum-travel[i]-travel[i+1]+abs(num[i+2]-num[i]));

		pfn;

	}

	

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

#include<map>

#include<set>

#include<queue>

#define ll long long

using namespace std;

int pos(int n)

{

    if(n<0)

        return 0;

    else

        return n;

}

int main()

{

    int a[100002][2]= {0};

    int n;

    cin>>n;

    ll sum=0;

    for(int i=1; i<=n; i++)

    {

        scanf("%d",&a[i][0]);

 

        sum+=abs(a[i-1][0]-a[i][0]);

    }

    sum+=abs(a[n][0]);

    for(int i=1; i<=n; i++)

    {

 

            cout<<sum-abs(a[i][0]-a[i+1][0])-abs(a[i][0]-a[i-1][0])+abs(a[i-1][0]-a[i+1][0])<<endl;

 

  

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.7794801200343284x):
#include <iostream>

#include <cmath>

#include <stdio.h>

#include <algorithm>

#include <string>

#include <vector>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <cstring>



using namespace std;



#define f first

#define s second

#define pb push_back

#define mp make_pair

#define ll long long

#define pii pair < int, int >

#define pll pair < long long, long long>

#define ull unsigned long long

#define vi vector < int >

#define vll vector < long long >

#define sz(a) (int)a.size()

#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it++)

#define all(a) a.begin(), a.end()

#define sqr(x) ((x) * (x))

#define fname "searching"



const int inf = (int)1e9;

const ll INF = (ll)1e18;

const double eps = 1e-9;

const double pi = acos(-1.0);

const int mod = (int)1e9 + 7;



int n;

vll v;

ll sum[100100];



void solve(){

    cin >> n;

    v.pb(0);

    for(int i = 0; i < n; ++i){

        ll x;

        cin >> x;

        sum[i + 1] = sum[i] + abs(x - v.back());

        v.pb(x);

    }

    //for(int i = 0; i < n + 1; ++i) cout << sum[i] << " ";



    for(int i = 1; i < n; ++i){

        int cur = sum[i - 1] + abs(v[i + 1] - v[i - 1]) + sum[n] - sum[i + 1] + abs(v[n]);

        cout << cur << "\n";

    }

    cout << sum[n - 1] + abs(v[n - 1]) << "\n";

}



int main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);



    solve();

    

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

#include<map>

#include<set>

#include<queue>

#define ll long long

using namespace std;

int pos(int n)

{

    if(n<0)

        return 0;

    else

        return n;

}

int main()

{

    int a[100002][2]= {0};

    int n;

    cin>>n;

    ll sum=0;

    for(int i=1; i<=n; i++)

    {

        scanf("%d",&a[i][0]);

 

        sum+=abs(a[i-1][0]-a[i][0]);

    }

    sum+=abs(a[n][0]);

    for(int i=1; i<=n; i++)

    {

 

            cout<<sum-abs(a[i][0]-a[i+1][0])-abs(a[i][0]-a[i-1][0])+abs(a[i-1][0]-a[i+1][0])<<endl;

 

  

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.8074981591841182x):
#include<bits/stdc++.h>

typedef long long ll;

#define dbg          cout<<"Freak"<<endl;

#define dbgg(i)      cout<<i<<endl;

#define N            1e9+7;

#define pb           push_back

using namespace std;

ll t;

ll arr[300005];

vector<ll>v;



int main()

{

    ll a,b,c,d,e,f,g,i,j;

    cin>>t;

    v.pb(0);

    f=0;

    for(i=0;i<t;i++)

    {

        cin>>a;

        v.push_back(a);

        b=abs(a-v[i]);

        f+=b;

    }

    v.pb(0);

    b=abs(0-v[t]);

    f+=b;

    for(i=1;i<=t;i++)

    {

        b=abs(v[i]-v[i-1]);

        c=abs(v[i]-v[i+1]);

        g=f-b-c;

        g=g+abs(v[i+1]-v[i-1]);

        cout<<g<<endl;

    }

    return 0;

}