sortbooks.cpp: In function 'void build(int, int, int)':
sortbooks.cpp:23:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid = tl + tr >> 1;
~~~^~~~
sortbooks.cpp: In function 'int get(int, int, int, int, int)':
sortbooks.cpp:36:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid = tl + tr >> 1;
~~~^~~~
sortbooks.cpp: At global scope:
sortbooks.cpp:87:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main() {
^
sortbooks.cpp: In function 'void solve()':
sortbooks.cpp:46:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d", &l, &r, &k);
~~~~~^~~~~~~~~~~~~~~~~~~~~~
sortbooks.cpp: In function 'int main()':
sortbooks.cpp:88:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &n, &tests);
~~~~~^~~~~~~~~~~~~~~~~~~~
sortbooks.cpp:90:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &a[i]);
~~~~~^~~~~~~~~~~~~