Problem: 2062C - Cirno and Operations
Language: c++17 

Solution 1 (runtime: 62 ms):
#include<bits/stdc++.h>
using namespace std;
 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
#define ordered_set tree<int,null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
 
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define int long long int
#define dec greater<int>()
#define all(x) (x).begin(), (x).end()
#define mod 1000000007
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) { return (a.second < b.second); }
 
void solve()
{
    int n;
    cin>>n;
    vector<int>v(n);
    for(auto &i : v) cin>>i;

    int now_length=n;
    int ans=INT_MIN;
    for(int i=0; i<n; i++)
    {
        int sum=accumulate(v.begin(),v.begin()+now_length,0LL);
        if(i>0)
            sum=abs(sum);
        ans=max(ans,sum);
        for(int i=0; i<now_length; i++)v[i]=v[i+1]-v[i];
        now_length--;
    }
    cout<<ans<<'\n';
    
}
 
signed main()
{
    fast;    
    int t=1;
    cin>>t;
    while(t--)
      solve();
}

Solution 2 (runtime: 61 ms):
#include <bits/stdc++.h>

#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define ll long long
#define ull unsigned ll

#define v vector
#define vll vector<ll>
#define vb vector<bool>

#define p pair
#define pll pair<ll, ll>

#define uset unordered_set
#define umap unordered_map
#define sll set<ll>
#define mpll map<ll, ll>

#define dqll deque<ll>
#define stll stack<ll>
#define qll queue<ll>

#define fi first
#define se second

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front

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

using namespace std;

// STRUCTS & CLASSES
///////////////////////////////////////////////////////////////////////////



// GLOBALS
///////////////////////////////////////////////////////////////////////////

ll n, t;
vll arr;

// HELPER FUNCS
///////////////////////////////////////////////////////////////////////////

vll diff(vll& arr)
{
    vll res(arr.size() - 1);
    for (ll i = 0; i < arr.size() - 1; i++)
    {
        res[i] = arr[i + 1] - arr[i];
    }
    return res;
}

ll sum(vll& arr)
{
    ll res = 0;
    for (auto i : arr)
    {
        res += i;
    }
    return res;
}

ll solve(vll& arr, ll depth = 0)
{
    if (arr.size() == 1)
    {
        return arr[0];
    }

    ll s = sum(arr);
    vll d = diff(arr);
    ll s1 = solve(d, depth + 1);

//    cout << d << '\n';
//    cout << s << ' ' << s1 << '\n';

    if (depth == 0)
    {
//        cout << max(s, abs(s1)) << '\n';
        return max(s, abs(s1));
    }
    else
    {
        return max(abs(s), abs(s1));
    }
}

// MAIN
///////////////////////////////////////////////////////////////////////////

int main()
{
    fastio;
//    freopen("test.inp", "r", stdin);
//    freopen("test.out", "w", stdout);

    // input
    cin >> t;

    // solve
    while (t--)
    {
        // test input
        cin >> n;
        arr.resize(n);
        for (ll i = 0; i < n; i++)
            cin >> arr[i];

        // test solve
//        cout << arr << "\n\n";

        cout << solve(arr) << '\n';
    }

    return 0;
}