#include using namespace std; using ll=long long; #define rep2(i, a, n) for(int i = (a); i < (n); i++) #define rep(i, n) rep2(i,0,n) template inline bool chmax(T& a, T b){if(a>n>>m; ll hoge; vector a(n,0); rep(i,n){ rep(j,m){ cin>>hoge; a[i]+=hoge; } } vector> dp(n,vector(2,0)); dp[0][0]=a[0]; rep(i,n-1){ dp[i+1][0]=max(dp[i][0],dp[i][1]+a[i+1]); dp[i+1][1]=max(dp[i][1],dp[i][0]-a[i+1]); } /* rep(i,n){ cout<