Language: C++

#include <iostream>
#include <iostream>
#include <iterator>
#include <vector>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long llu;
typedef long double lld;
typedef pair<int,int> pi;
#define lli 			long long int
#define mod				(ll) 1000000007
#define pb 				push_back
#define f(i,s,n) 		for (int i=s;i<n;i++)
#define vii				vector<int>
#define seti      set<int>
#define mapi      map<int,int>
#define mapv      map<int,vii>
#define vll				vector<ll>
#define vpp				vector<pp>
#define vss				vector<string>
#define lcm(a,b)		(a*b)/__gcd(a,b)
#define all(a)			a.begin(),a.end()
#define abs(a) 			a>0?a:-1*a
#define all(a)			a.begin(),a.end()
#define fo(i,a)       for(auto &i:a)
#define bs(v,x)			binary_search(all(v),x)
#define sort(ans)    sort(ans.begin(),ans.end());
#define sortrev(ans) sort(a.begin(), a.end(), greater<int>());
#define vii2d       vector<vector<int>>
#define ms          multiset<int>
void solve()
{
  lli n,k,j;
  cin>>n>>k>>j;
  lli cop=n;
  lli ans=0;
  lli r=abs(n);
  lli step=r/j;
  lli w=0;
  //cout<<step<<endl;
  if (n>=0)
  {  n-=step*j;
    w=n-j;}
  else
  {  n+=step*j;
    w=n+j;}
  k-=step;
  if (k<=0)
  {
    k+=step;
    if (cop>=0)
      cop-=k*j;
    else
      cop+=k*j;
    cout<<cop<<endl;
    return;
  }
  if (k%2==0)
  ans=n;
  else
  ans=w;
  cout<<abs(ans)<<endl;
}
int main()
{
    int t=1;
    //cin>>t;
    int count=1;
    while(t--)
    {
      solve();
      count+=1;
    }
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:25:34: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int')
   25 | #define abs(a)                  a>0?a:-1*a
      |                                  ^~
      |                                   |
      |                                   int
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
a.cc:25:34: note: candidate: 'operator>(int, int)' (built-in)
   25 | #define abs(a)                  a>0?a:-1*a
      |                                  ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
a.cc:25:34: note:   no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                  ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
                 from a.cc:6:
/usr/include/c++/14/bits/regex.h:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
 1176 |     operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1176:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
/usr/include/c++/14/bits/regex.h:1236:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
 1236 |     operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1236:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
/usr/include/c++/14/bits/regex.h:1329:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
 1329 |     operator>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1329:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
/usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
 1403 |     operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1403:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
/usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
 1497 |     operator>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1497:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
/usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
 1573 |     operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1573:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
/usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
 1673 |     operator>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1673:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  462 |     operator>(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  507 |     operator>(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1714 |     operator>(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1774 |     operator>(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
   25 | #define abs(a)                  a>0?a:-1*a
      |                                   ^
a.cc:64:9: note: in expansion of macro 'abs'
   64 |   cout<<abs(ans)<<endl;
      |         ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1058 |     operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std