Problem: 2062C - Cirno and Operations
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
// [Irelia]
#include<bits/stdc++.h>

namespace Irelia // [Irelia Library] Irelia
{
    #define Irelia__ 201307
    #define fcc(i, j, k) for(int (i)=(j); (i)<=(k); ++(i))
    #define ccf(i, j, k) for(int (i)=(j); (i)>=(k); --(i))
    #define I (*this)

    using Int = long long;
    using uint = unsigned int;
    using uInt = unsigned long long;

    const char newl = '\n', *snewl = " \n";

    inline Int read()
    {
        Int ret = 0, s = 1, c = getchar();
        for(; !isdigit(c); c = getchar()) if(c == '-') s = -1;
        for(; isdigit(c); c = getchar()) ret = (ret << 1) + (ret << 3) + (c ^ 48);
        return s * ret;
    }
    inline std::string readstr()
    {
        std::string ret; char c = getchar();
        for(; c <= ' '; c = getchar());
        for(; c > ' '; c = getchar()) ret += c;
        return ret;
    }
    template<typename T>
    constexpr void min_(T &t, const T &u) { if(u < t) t = u; }
    template<typename T>
    constexpr void max_(T &t, const T &u) { if(t < u) t = u; }
    template<typename T>
    constexpr inf() { return (std::numeric_limits<T>::max() - Irelia__) / 2; }

    template<typename T>
    class vector : public std::vector<T>
    {
        public:
        int size() { return std::vector<T>::size(); }
        T &operator [] (int i)
        {
            #ifdef DEBUG__
            assert(0 <= i && i < size());
            #endif
            return std::vector<T>::operator[](i);
        }
        operator bool () { return !I.empty(); }
        void set(int siz) { I.resize(siz); }
        void push(auto &&...t) { I.emplace_back(t...); }
        void pop() { I.pop_back(); }
        void reverse() { std::reverse(I.begin(), I.end()); }
        template<typename Tl = std::less<T>>
        void sort() { std::sort(I.begin(), I.end(), Tl()); }
        template<typename Tl = std::less<T>>
        int lower(const T &t) { return std::lower_bound(I.begin(), I.end(), t, Tl()) - I.begin(); }
        template<typename Tl = std::less<T>>
        int upper(const T &t) { return std::upper_bound(I.begin(), I.end(), t, Tl()) - I.begin(); }
        template<typename Tl = std::less<T>>
        void discretize()
        {
            sort<Tl>(), set(std::unique(I.begin(), I.end(),
                [&](T &a, T &b) { return !Tl()(a, b) && !Tl()(b, a); }) - I.begin());
        }
    };
}

using namespace Irelia;

void solve()
{
    int N = read(), ans = 0;
    std::vector<int> A(N + 1);
    fcc(i, 1, N) A[i] = read(), ans += A[i];
    ans = std::abs(ans);
    fcc(i, 1, N - 1)
    {
        int sum = 0;
        fcc(j, 1, N - i) A[j] = A[j + 1] - A[j], sum += A[j];
        max_(ans, std::abs(sum));
    }
    std::cout << ans << newl;
}
int main()
{
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    std::cin.tie(0)->sync_with_stdio(0);

    for(int T = read(); T --> 0;) solve();
}

Submission (verdict: Wrong answer on test 2):
// [Irelia]
#include<bits/stdc++.h>

namespace Irelia // [Irelia Library] Irelia
{
    #define Irelia__ 201307
    #define fcc(i, j, k) for(int (i)=(j); (i)<=(k); ++(i))
    #define ccf(i, j, k) for(int (i)=(j); (i)>=(k); --(i))
    #define I (*this)

    using Int = long long;
    using uint = unsigned int;
    using uInt = unsigned long long;

    const char newl = '\n', *snewl = " \n";

    inline Int read()
    {
        Int ret = 0, s = 1, c = getchar();
        for(; !isdigit(c); c = getchar()) if(c == '-') s = -1;
        for(; isdigit(c); c = getchar()) ret = (ret << 1) + (ret << 3) + (c ^ 48);
        return s * ret;
    }
    inline std::string readstr()
    {
        std::string ret; char c = getchar();
        for(; c <= ' '; c = getchar());
        for(; c > ' '; c = getchar()) ret += c;
        return ret;
    }
    template<typename T>
    constexpr void min_(T &t, const T &u) { if(u < t) t = u; }
    template<typename T>
    constexpr void max_(T &t, const T &u) { if(t < u) t = u; }
    template<typename T>
    constexpr inf() { return (std::numeric_limits<T>::max() - Irelia__) / 2; }

    template<typename T>
    class vector : public std::vector<T>
    {
        public:
        int size() { return std::vector<T>::size(); }
        T &operator [] (int i)
        {
            #ifdef DEBUG__
            assert(0 <= i && i < size());
            #endif
            return std::vector<T>::operator[](i);
        }
        operator bool () { return !I.empty(); }
        void set(int siz) { I.resize(siz); }
        void push(auto &&...t) { I.emplace_back(t...); }
        void pop() { I.pop_back(); }
        void reverse() { std::reverse(I.begin(), I.end()); }
        template<typename Tl = std::less<T>>
        void sort() { std::sort(I.begin(), I.end(), Tl()); }
        template<typename Tl = std::less<T>>
        int lower(const T &t) { return std::lower_bound(I.begin(), I.end(), t, Tl()) - I.begin(); }
        template<typename Tl = std::less<T>>
        int upper(const T &t) { return std::upper_bound(I.begin(), I.end(), t, Tl()) - I.begin(); }
        template<typename Tl = std::less<T>>
        void discretize()
        {
            sort<Tl>(), set(std::unique(I.begin(), I.end(),
                [&](T &a, T &b) { return !Tl()(a, b) && !Tl()(b, a); }) - I.begin());
        }
    };
}

using namespace Irelia;

void solve()
{
    int N = read(), ans = 0;
    std::vector<int> A(N + 1);
    fcc(i, 1, N) A[i] = read(), ans += A[i];
    if(N == 1) return std::cout << A[1] << newl, void();
    ans = std::abs(ans);
    fcc(i, 1, N - 1)
    {
        int sum = 0;
        fcc(j, 1, N - i) A[j] = A[j + 1] - A[j], sum += A[j];
        max_(ans, std::abs(sum));
    }
    std::cout << ans << newl;
}
int main()
{
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    std::cin.tie(0)->sync_with_stdio(0);

    for(int T = read(); T --> 0;) solve();
}