ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>

using namespace std;

int tab[100005];
bool dp[100005][9];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int n=s.size();
        for(int i=0;i<n;i++){
            tab[i]=s[i]-'0';
        }
        if(tab[0]*tab[0]<10){
            dp[0][tab[0]]=true;
            dp[0][tab[0]*tab[0]]=true;
        }else{
            dp[0][tab[0]]=true;
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<9;j++){
                if(dp[i-1][j]==true){
                    if(tab[i]*tab[i]<10){
                        dp[i][(j+tab[i])%9]=true;
                        dp[i][(j+tab[i]*tab[i])%9]=true;
                    }else{
                        dp[i][(j+tab[i])%9]=true;
                    }
                }
            }
        }
        if(dp[n-1][0]==true){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
        for(int i=0;i<n;i++){
            tab[i]=0;
            for(int j=0;j<9;j++){
                dp[i][j]=false;
            }
        }
    }
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>

using namespace std;

int tab[100005];
bool dp[100005][9];

int main(){
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int n=s.size();
        for(int i=0;i<n;i++){
            tab[i]=s[i]-'0';
        }
        if(tab[0]*tab[0]<10){
            dp[0][tab[0]]=true;
            dp[0][(tab[0]*tab[0])%9]=true;
        }else{
            dp[0][tab[0]]=true;
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<9;j++){
                if(dp[i-1][j]==true){
                    if(tab[i]*tab[i]<10){
                        dp[i][(j+tab[i])%9]=true;
                        dp[i][(j+tab[i]*tab[i])%9]=true;
                    }else{
                        dp[i][(j+tab[i])%9]=true;
                    }
                }
            }
        }
        if(dp[n-1][0]==true){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
        for(int i=0;i<n;i++){
            tab[i]=0;
            for(int j=0;j<9;j++){
                dp[i][j]=false;
            }
        }
    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>

using namespace std;

int tab[100005];
bool dp[100005][9];

int main(){
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int n=s.size();
        for(int i=0;i<n;i++){
            tab[i]=s[i]-'0';
        }
        if(tab[0]*tab[0]<10){
            dp[0][tab[0]]=true;
            dp[0][(tab[0]*tab[0])%9]=true;
        }else{
            dp[0][tab[0]]=true;
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<9;j++){
                if(dp[i-1][j]==true){
                    if(tab[i]*tab[i]<10){
                        dp[i][(j+tab[i])%9]=true;
                        dp[i][(j+tab[i]*tab[i])%9]=true;
                    }else{
                        dp[i][(j+tab[i])%9]=true;
                    }
                }
            }
        }
        if(dp[n-1][0]==true){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
        for(int i=0;i<n;i++){
            tab[i]=0;
            for(int j=0;j<9;j++){
                dp[i][j]=false;
            }
        }
    }
    return 0;
}

Submission (verdict: Accepted):
#include <iostream>
#include <vector>

using namespace std;

int tab[100005];
bool dp[100005][9];

int main(){
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int n=s.size();
        for(int i=0;i<n;i++){
            tab[i]=s[i]-'0';
        }
        if(tab[0]*tab[0]<10){
            dp[0][tab[0]%9]=true;
            dp[0][(tab[0]*tab[0])%9]=true;
        }else{
            dp[0][tab[0]%9]=true;
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<9;j++){
                if(dp[i-1][j]==true){
                    if(tab[i]*tab[i]<10){
                        dp[i][(j+tab[i])%9]=true;
                        dp[i][(j+tab[i]*tab[i])%9]=true;
                    }else{
                        dp[i][(j+tab[i])%9]=true;
                    }
                }
            }
        }
        if(dp[n-1][0]==true){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
        for(int i=0;i<n;i++){
            tab[i]=0;
            for(int j=0;j<9;j++){
                dp[i][j]=false;
            }
        }
    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>

using namespace std;

int tab[100005];
bool dp[100005][9];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int n=s.size();
        for(int i=0;i<n;i++){
            tab[i]=s[i]-'0';
        }
        if(tab[0]*tab[0]<10){
            dp[0][tab[0]]=true;
            dp[0][tab[0]*tab[0]]=true;
        }else{
            dp[0][tab[0]]=true;
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<9;j++){
                if(dp[i-1][j]==true){
                    if(tab[i]*tab[i]<10){
                        dp[i][(j+tab[i])%9]=true;
                        dp[i][(j+tab[i]*tab[i])%9]=true;
                    }else{
                        dp[i][(j+tab[i])%9]=true;
                    }
                }
            }
        }
        if(dp[n-1][0]==true){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
        for(int i=0;i<n;i++){
            tab[i]=0;
            for(int j=0;j<9;j++){
                dp[i][j]=false;
            }
        }
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

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

using i64 = long long;

void solve() {
    int l, r;
    std::cin >> l >> r;
    int a, b, c = l;
    a = b = 0;
    for (int i = 29; i >= 0; i --) {
        if ((l ^ r) >> i & 1) {
            b |= 1 << i;
            a |= (1 << i) - 1;
        } else {
            a |= l & (1 << i); 
            b |= l & (1 << i);
        }
    }
    while (c == a or c == b)
        c ++;
    std::println("{} {} {}", a, b, c);
}

signed main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int t = 1;
    std::cin >> t;
    while (t --) {
        solve();
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>

using i64 = long long;

void solve() {
    int l, r;
    std::cin >> l >> r;
    int a, b, c = l;
    a = b = 0;
    for (int i = 29; i >= 0; i --) {
        if ((l ^ r) >> i & 1) {
            b |= 1 << i;
            a |= (1 << i) - 1;
            break;
        } else {
            a |= l & (1 << i); 
            b |= l & (1 << i);
        }
    }
    while (c == a or c == b)
        c ++;
    std::println("{} {} {}", a, b, c);
}

signed main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int t = 1;
    std::cin >> t;
    while (t --) {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

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

using i64 = long long;

void solve() {
    int l, r;
    std::cin >> l >> r;
    int a, b, c;
    a = b = c = 0;
    for (int i = 29; i >= 0; i --) {
        if ((l ^ r) >> i & 1) {
            b |= 1 << i;
            a |= (1 << i) - 1;
        } else {
            a |= l & (1 << i); 
            b |= l & (1 << i);
        }
    }
    std::println("{} {} {}", a, b, std::min({a, b, l}));
}

signed main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int t = 1;
    std::cin >> t;
    while (t --) {
        solve();
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

using i64 = long long;

void solve() {
    int l, r;
    std::cin >> l >> r;
    int a, b, c;
    a = b = c = l;
    for (int i = 29; i >= 0; i --) {
        if ((l ^ r) >> i & 1) {
            b |= 1 << i;
            a |= (1 << i) - 1;
        } else {
            a |= l & (1 << i); 
            b |= l & (1 << i);
        }
    }
    while (c == a or c == b)
        c ++;
    std::println("{} {} {}", a, b, c);
}

signed main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int t = 1;
    std::cin >> t;
    while (t --) {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

using i64 = long long;

void solve() {
    int l, r;
    std::cin >> l >> r;
    int a, b, c;
    a = b = c = 0;
    for (int i = 29; i >= 0; i --) {
        if ((l ^ r) >> i & 1) {
            b |= 1 << i;
            a |= (1 << i) - 1;
        } else {
            a |= l & (1 << i); 
            b |= l & (1 << i);
        }
    }
    std::println("{} {} {}", a, b, std::min({a, b, l}));
}

signed main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int t = 1;
    std::cin >> t;
    while (t --) {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

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

using i64 = long long;

void solve() {
    int l, r;
    std::cin >> l >> r;
    int a, b, c;
    a = b = c = l;
    for (int i = 29; i >= 0; i --) {
        if ((l ^ r) >> i & 1) {
            b |= 1 << i;
            a |= (1 << i) - 1;
        } else {
            a |= l & (1 << i); 
            b |= l & (1 << i);
        }
    }
    while (c == a or c == b)
        c ++;
    std::println("{} {} {}", a, b, c);
}

signed main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int t = 1;
    std::cin >> t;
    while (t --) {
        solve();
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

using i64 = long long;

void solve() {
    int l, r;
    std::cin >> l >> r;
    int a, b, c = l;
    a = b = 0;
    for (int i = 29; i >= 0; i --) {
        if ((l ^ r) >> i & 1) {
            b |= 1 << i;
            a |= (1 << i) - 1;
        } else {
            a |= l & (1 << i); 
            b |= l & (1 << i);
        }
    }
    while (c == a or c == b)
        c ++;
    std::println("{} {} {}", a, b, c);
}

signed main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int t = 1;
    std::cin >> t;
    while (t --) {
        solve();
    }
    return 0;
}
Problem: 2061D - Kevin and Numbers
Language: Go


Submission (verdict: Wrong answer on test 3):
package main 



import (

	."fmt"

	"os"

	"bufio"

)



var (

	in = bufio.NewReader(os.Stdin)

	out = bufio.NewWriter(os.Stdout)

)



func solve() {

	var n, m int 

	Fscan(in, &n, &m)

	mp1 := make(map[int]int)

	for i := 0; i < n; i++ {

		var val int 

		Fscan(in, &val)

		mp1[val]++

	}



	for i := 0; i < m; i++ {

		var val int 

		Fscan(in, &val)

		queue := make([]int, 1)

		queue[0] = val 

		for len(queue) > 0 && len(queue) <= n {

			top := queue[0]

			queue = queue[1:]

			if mp1[top] > 0 {

				mp1[top]--

				continue

			}

			queue = append(queue, top/2)

			queue = append(queue, top - top/2)

			if top <= 1 {

				break	

			}

		}

		if len(queue) > 0 {

			Fprintln(out, "No")

			return

		}

	}

	for _, val := range mp1 {

		if val != 0 {

			Fprintln(out, "No")

			return

		}

	}

	Fprintln(out, "Yes")

}



func main() {



	defer out.Flush()



	var T int 

	for Fscan(in, &T); T > 0; T-- {

		solve()

	}

}
Problem: 2061D - Kevin and Numbers
Language: Go

Previous submission (verdict: Wrong answer on test 3):
package main 



import (

	."fmt"

	"os"

	"bufio"

)



var (

	in = bufio.NewReader(os.Stdin)

	out = bufio.NewWriter(os.Stdout)

)



func solve() {

	var n, m int 

	Fscan(in, &n, &m)

	mp1 := make(map[int]int)

	for i := 0; i < n; i++ {

		var val int 

		Fscan(in, &val)

		mp1[val]++

	}



	for i := 0; i < m; i++ {

		var val int 

		Fscan(in, &val)

		queue := make([]int, 1)

		queue[0] = val 

		for len(queue) > 0 && len(queue) <= n {

			top := queue[0]

			queue = queue[1:]

			if mp1[top] > 0 {

				mp1[top]--

				continue

			}

			queue = append(queue, top/2)

			queue = append(queue, top - top/2)

			if top <= 1 {

				break	

			}

		}

		if len(queue) > 0 {

			Fprintln(out, "No")

			return

		}

	}

	for _, val := range mp1 {

		if val != 0 {

			Fprintln(out, "No")

			return

		}

	}

	Fprintln(out, "Yes")

}



func main() {



	defer out.Flush()



	var T int 

	for Fscan(in, &T); T > 0; T-- {

		solve()

	}

}

Submission (verdict: Wrong answer on test 3):
package main 



import (

	."fmt"

	"os"

	"bufio"

)



var (

	in = bufio.NewReader(os.Stdin)

	out = bufio.NewWriter(os.Stdout)

)



func sol(mp map[int]int, val int) bool {

	if val == 0 {

		return false

	}

	if mp[val] > 0 {

		mp[val]--

		return true

	}

	if val == 1 {

		return false

	}

	f1:= sol(mp, val/2) 

	if !f1 {

		return false

	}

	f2 := sol(mp, val - val/2)

	if !f2 {

		return false

	}

	return true

}



func solve() {

	var n, m int 

	Fscan(in, &n, &m)

	mp1 := make(map[int]int)

	for i := 0; i < n; i++ {

		var val int 

		Fscan(in, &val)

		mp1[val]++

	}



	for i := 0; i < m; i++ {

		var val int 

		Fscan(in, &val)

		

		if sol(mp1, val) == false {

			Fprintln(out, "No")

			return

		}



	}

	for _, val := range mp1 {

		if val != 0 {

			Fprintln(out, "No")

			return

		}

	}

	Fprintln(out, "Yes")

}



func main() {



	defer out.Flush()



	var T int 

	for Fscan(in, &T); T > 0; T-- {

		solve()

	}

}
Problem: 2061D - Kevin and Numbers
Language: Go

Previous submission (verdict: Wrong answer on test 3):
package main 



import (

	."fmt"

	"os"

	"bufio"

)



var (

	in = bufio.NewReader(os.Stdin)

	out = bufio.NewWriter(os.Stdout)

)



func sol(mp map[int]int, val int) bool {

	if val == 0 {

		return false

	}

	if mp[val] > 0 {

		mp[val]--

		return true

	}

	if val == 1 {

		return false

	}

	f1:= sol(mp, val/2) 

	if !f1 {

		return false

	}

	f2 := sol(mp, val - val/2)

	if !f2 {

		return false

	}

	return true

}



func solve() {

	var n, m int 

	Fscan(in, &n, &m)

	mp1 := make(map[int]int)

	for i := 0; i < n; i++ {

		var val int 

		Fscan(in, &val)

		mp1[val]++

	}



	for i := 0; i < m; i++ {

		var val int 

		Fscan(in, &val)

		

		if sol(mp1, val) == false {

			Fprintln(out, "No")

			return

		}



	}

	for _, val := range mp1 {

		if val != 0 {

			Fprintln(out, "No")

			return

		}

	}

	Fprintln(out, "Yes")

}



func main() {



	defer out.Flush()



	var T int 

	for Fscan(in, &T); T > 0; T-- {

		solve()

	}

}

Submission (verdict: Accepted):
package main 



import (

	."fmt"

	"os"

	"bufio"

	"sort"

)



var (

	in = bufio.NewReader(os.Stdin)

	out = bufio.NewWriter(os.Stdout)

)



func sol(mp map[int]int, val int) bool {

	if mp[val] > 0 {

		mp[val]--

		return true

	}

	if val == 1 {

		return false

	}

	f1:= sol(mp, val/2) 

	if !f1 {

		return false

	}

	f2 := sol(mp, val - val/2)

	if !f2 {

		return false

	}

	return true

}



func solve() {

	var n, m int 

	Fscan(in, &n, &m)

	mp1 := make(map[int]int)

	ar := make([]int, 0)

	for i := 0; i < n; i++ {

		var val int 

		Fscan(in, &val)

		mp1[val]++

	}



	for i := 0; i < m; i++ {

		var val int 

		Fscan(in, &val)

		if mp1[val] > 0 {

			mp1[val]--

		} else {

			ar = append(ar, val)

		}

	}

	sort.Ints(ar)

	for _, val := range ar {

		if !sol(mp1, val) {

			Fprintln(out, "No")

			return

		} 

	}

	for _, val := range mp1 {

		if val != 0 {

			Fprintln(out, "No")

			return

		}

	}

	Fprintln(out, "Yes")

}



func main() {



	defer out.Flush()



	var T int 

	for Fscan(in, &T); T > 0; T-- {

		solve()

	}

}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <bits/stdc++.h>
using  namespace std;

#define ll long long

int sumOfDigit(int x) {
    int sm = 0;
    while (x)
    {
        sm += x % 10;
        x /=10;
    }
    return sm;
    
}

int checkIfSorted(vector<int> arr) {
    vector<int> lst = arr;
    sort(lst.begin(),lst.end());
    if (lst == arr) return true;
    return false;
}

int main() {
    int t;
    cin>>t;
   
    while(t--) {
        int n;
        cin >> n;
        vector<int> arr(n);
        
        for (size_t i = 0; i < n; i++)
        {
            cin >> arr[i];
        }
       
        int ans = 0;
        for (size_t i = 0; i < n; i++)
        {
            ans += arr[i];
        }
        
        while (arr.size() != 1)
        {
            reverse(arr.begin(),arr.end());
            int sum = 0;
            vector<int> lst;
            for (size_t i = 1; i < arr.size(); i++)
            {
                lst.push_back(arr[i]-arr[i-1]);
                sum += lst[i-1];
            }
            arr = lst;
            ans = max(ans,sum);
        }
        cout << ans << endl;
        
    }
        
    return 0;

}

Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <bits/stdc++.h>
using  namespace std;

#define ll long long

int sumOfDigit(int x) {
    int sm = 0;
    while (x)
    {
        sm += x % 10;
        x /=10;
    }
    return sm;
    
}

int checkIfSorted(vector<int> arr) {
    vector<int> lst = arr;
    sort(lst.begin(),lst.end());
    if (lst == arr) return true;
    return false;
}

int main() {
    int t;
    cin>>t;
   
    while(t--) {
        int n;
        cin >> n;
        vector<ll> arr(n);
        
        for (size_t i = 0; i < n; i++)
        {
            cin >> arr[i];
        }
       
        ll ans = 0;
        for (size_t i = 0; i < n; i++)
        {
            ans += arr[i];
        }
        
        while (arr.size() != 1)
        {
            reverse(arr.begin(),arr.end());
            ll sum = 0;
            vector<ll> lst;
            for (size_t i = 1; i < arr.size(); i++)
            {
                lst.push_back(arr[i]-arr[i-1]);
                sum += lst[i-1];
            }
            arr = lst;
            ans = max(ans,sum);
        }
        cout << ans << endl;
        
    }
        
    return 0;

}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <bits/stdc++.h>
using  namespace std;

#define ll long long

int sumOfDigit(int x) {
    int sm = 0;
    while (x)
    {
        sm += x % 10;
        x /=10;
    }
    return sm;
    
}

int checkIfSorted(vector<int> arr) {
    vector<int> lst = arr;
    sort(lst.begin(),lst.end());
    if (lst == arr) return true;
    return false;
}

int main() {
    int t;
    cin>>t;
   
    while(t--) {
        int n;
        cin >> n;
        vector<int> arr(n);
        
        for (size_t i = 0; i < n; i++)
        {
            cin >> arr[i];
        }
       
        int ans = 0;
        for (size_t i = 0; i < n; i++)
        {
            ans += arr[i];
        }
        
        while (arr.size() != 1)
        {
            reverse(arr.begin(),arr.end());
            int sum = 0;
            vector<int> lst;
            for (size_t i = 1; i < arr.size(); i++)
            {
                lst.push_back(arr[i]-arr[i-1]);
                sum += lst[i-1];
            }
            arr = lst;
            ans = max(ans,sum);
        }
        cout << ans << endl;
        
    }
        
    return 0;

}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <bits/stdc++.h>
using  namespace std;

#define ll long long

int sumOfDigit(int x) {
    int sm = 0;
    while (x)
    {
        sm += x % 10;
        x /=10;
    }
    return sm;
    
}

int checkIfSorted(vector<int> arr) {
    vector<int> lst = arr;
    sort(lst.begin(),lst.end());
    if (lst == arr) return true;
    return false;
}

int main() {
    int t;
    cin>>t;
   
    while(t--) {
        int n;
        cin >> n;
        vector<ll> arr(n);
        
        for (size_t i = 0; i < n; i++)
        {
            cin >> arr[i];
        }
       
        ll ans = 0;
        for (size_t i = 0; i < n; i++)
        {
            ans += arr[i];
        }
        
        while (arr.size() != 1)
        {
            reverse(arr.begin(),arr.end());
            ll sum = 0;
            vector<ll> lst;
            for (size_t i = 1; i < arr.size(); i++)
            {
                lst.push_back(arr[i]-arr[i-1]);
                sum += lst[i-1];
            }
            arr = lst;
            ans = max(ans,sum);
        }
        cout << ans << endl;
        
    }
        
    return 0;

}

Submission (verdict: Accepted):
#include <iostream>
#include <bits/stdc++.h>
using  namespace std;

#define ll long long

int sumOfDigit(int x) {
    int sm = 0;
    while (x)
    {
        sm += x % 10;
        x /=10;
    }
    return sm;
    
}

int checkIfSorted(vector<int> arr) {
    vector<int> lst = arr;
    sort(lst.begin(),lst.end());
    if (lst == arr) return true;
    return false;
}

int main() {
    int t;
    cin>>t;
   
    while(t--) {
        int n;
        cin >> n;
        vector<ll> arr(n);
        
        for (size_t i = 0; i < n; i++)
        {
            cin >> arr[i];
        }
       
        ll ans = 0;
        for (size_t i = 0; i < n; i++)
        {
            ans += arr[i];
        }
        
        while (arr.size() != 1)
        {
            vector<ll> cparr = arr;
            reverse(cparr.begin(),cparr.end());
            ll sum = 0;
            ll csum = 0;
            vector<ll> lst;
            vector<ll> cplst;
            for (size_t i = 1; i < arr.size(); i++)
            {
                cplst.push_back(cparr[i]-cparr[i-1]);
                csum += cplst[i-1];
            }
            for (size_t i = 1; i < arr.size(); i++)
            {
                lst.push_back(arr[i]-arr[i-1]);
                sum += lst[i-1];
            }
            if (sum > csum) {
                arr = lst;
                ans = max(ans,sum);
            } else {
                arr = cplst;
                ans = max(ans,csum);
            }
        }
        cout << ans << endl;
        
    }
        
    return 0;

}