/in/foo.cc: In function 'int main()':
/in/foo.cc:18:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(int j=1;j<=m;j++)
^~~
/in/foo.cc:20:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'
cin>>a1>>a2>>b1>>b2;
^~~
/in/foo.cc:31:18: error: reference to 'next' is ambiguous
tx=a[head].x+next[i][0];
^~~~
/in/foo.cc:6:5: note: candidates are: int next [4][4]
int next[4][4]={{-1,0},{1,0},{0,-1},{0,1}};
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:32:20: error: reference to 'next' is ambiguous
ty=a[head].y+next[i][1];
^~~~
/in/foo.cc:6:5: note: candidates are: int next [4][4]
int next[4][4]={{-1,0},{1,0},{0,-1},{0,1}};
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~