consul.cpp: In function 'void solve(int)':
consul.cpp:13:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
13 | sort(arr+1, arr+n);
| ^~~~
| std::sort
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from consul.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:4887:5: note: 'std::sort' declared here
4887 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
consul.cpp:20:22: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
20 | if(n%3==0&&cn>need || cn>=need)
| ~~~~~~^~~~~~~~~
consul.cpp:28:14: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
28 | if(n%3==0&&cn>need || cn>=need)
| ~~~~~~^~~~~~~~~