Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<set>
#include<string>
#include<stdio.h>
#include<cmath>
#include<map>
#include<bitset>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repn(i, n) for(int i = 1; i <= n; i++)
#define repr(i, n) for(int i = n-1; i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define lint lint lint

struct cake{ lint x, y, z; };

int main(){
    int n, m; cin >> n >> m;
    vector<cake> c;
    rep(i, n){
        lint x, y, z;
        cin >> x >> y >> z;
        c.push_back(cake{x, y, z});
    }

    lint ans = 0;
    rep(i, 8){
        bitset<3> bs(i);
        vector<lint> v;
        rep(j, n){
            v.push_back(c[j].x*(bs[0]*2-1) + c[j].y*(bs[1]*2-1) + c[j].z*(bs[2]*2-1));
        }
        sort(all(v), greater<int>());
        lint sum = 0;
        rep(j, m){
            sum += v[j];
        }
        ans = max(ans, sum);
    }

    cout << ans << endl;
}

Compiler output:
a.cc:18:14: error: 'lint' does not name a type
   18 | #define lint lint lint
      |              ^~~~
a.cc:20:14: note: in expansion of macro 'lint'
   20 | struct cake{ lint x, y, z; };
      |              ^~~~
a.cc: In function 'int main()':
a.cc:18:14: error: 'lint' was not declared in this scope
   18 | #define lint lint lint
      |              ^~~~
a.cc:26:9: note: in expansion of macro 'lint'
   26 |         lint x, y, z;
      |         ^~~~
a.cc:27:16: error: 'x' was not declared in this scope
   27 |         cin >> x >> y >> z;
      |                ^
a.cc:27:21: error: 'y' was not declared in this scope
   27 |         cin >> x >> y >> z;
      |                     ^
a.cc:27:26: error: 'z' was not declared in this scope
   27 |         cin >> x >> y >> z;
      |                          ^
a.cc:18:14: error: 'lint' was not declared in this scope
   18 | #define lint lint lint
      |              ^~~~
a.cc:31:5: note: in expansion of macro 'lint'
   31 |     lint ans = 0;
      |     ^~~~
a.cc:34:20: error: template argument 2 is invalid
   34 |         vector<lint> v;
      |                    ^
a.cc:36:15: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   36 |             v.push_back(c[j].x*(bs[0]*2-1) + c[j].y*(bs[1]*2-1) + c[j].z*(bs[2]*2-1));
      |               ^~~~~~~~~
a.cc:36:30: error: '__gnu_cxx::__alloc_traits<std::allocator<cake>, cake>::value_type' {aka 'struct cake'} has no member named 'x'
   36 |             v.push_back(c[j].x*(bs[0]*2-1) + c[j].y*(bs[1]*2-1) + c[j].z*(bs[2]*2-1));
      |                              ^
a.cc:36:51: error: '__gnu_cxx::__alloc_traits<std::allocator<cake>, cake>::value_type' {aka 'struct cake'} has no member named 'y'
   36 |             v.push_back(c[j].x*(bs[0]*2-1) + c[j].y*(bs[1]*2-1) + c[j].z*(bs[2]*2-1));
      |                                                   ^
a.cc:36:72: error: '__gnu_cxx::__alloc_traits<std::allocator<cake>, cake>::value_type' {aka 'struct cake'} has no member named 'z'
   36 |             v.push_back(c[j].x*(bs[0]*2-1) + c[j].y*(bs[1]*2-1) + c[j].z*(bs[2]*2-1));
      |                                                                        ^
a.cc:17:20: error: request for member 'begin' in 'v', which is of non-class type 'int'
   17 | #define all(x) (x).begin(), (x).end()
      |                    ^~~~~
a.cc:38:14: note: in expansion of macro 'all'
   38 |         sort(all(v), greater<int>());
      |              ^~~
a.cc:17:33: error: request for member 'end' in 'v', which is of non-class type 'int'
   17 | #define all(x) (x).begin(), (x).end()
      |                                 ^~~
a.cc:38:14: note: in expansion of macro 'all'
   38 |         sort(all(v), greater<int>());
      |              ^~~
a.cc:18:19: error: expected ';' before 'lint'
   18 | #define lint lint lint
      |                   ^~~~
a.cc:39:9: note: in expansion of macro 'lint'
   39 |         lint sum = 0;
      |         ^~~~
a.cc:41:13: error: 'sum' was not declared in this scope
   41 |             sum += v[j];
      |             ^~~
a.cc:41:21: error: invalid types 'int[int]' for array subscript
   41 |             sum += v[j];
      |                     ^
a.cc:43:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |         ans = max(ans, sum);
      |         ^~~
      |         abs
a.cc:43:24: error: 'sum' was not declared in this scope
   43 |         ans = max(ans, sum);
      |                        ^~~
a.cc:46:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |     cout << ans << endl;
      |             ^~~
      |             abs