books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:41:24: warning: unused variable 'sum' [-Wunused-variable]
41 | ll sum = a - x[i] - x[j], sum1 = x[i] + x[j] ;
| ^~~
books.cpp:41:47: warning: unused variable 'sum1' [-Wunused-variable]
41 | ll sum = a - x[i] - x[j], sum1 = x[i] + x[j] ;
| ^~~~
books.cpp:42:46: error: 'sum' was not declared in this scope
42 | if(a <= (*s.upper_bound({sum - 1, 0})).fi + sum1 && (*s.upper_bound({sum - 1, 0})).fi + sum1 <= 2 * a)
| ^~~
books.cpp:42:57: error: no matching function for call to 'std::set<std::pair<long long int, int> >::upper_bound(<brace-enclosed initializer list>)'
42 | if(a <= (*s.upper_bound({sum - 1, 0})).fi + sum1 && (*s.upper_bound({sum - 1, 0})).fi + sum1 <= 2 * a)
| ^
In file included from /usr/include/c++/10/set:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
from books.cpp:1:
/usr/include/c++/10/bits/stl_set.h:859:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::upper_bound(const key_type&) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::pair<long long int, int>, std::pair<long long int, int>, std::_Identity<std::pair<long long int, int> >, std::less<std::pair<long long int, int> >, std::allocator<std::pair<long long int, int> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = std::pair<long long int, int>]'
859 | upper_bound(const key_type& __x)
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:859:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const key_type&' {aka 'const std::pair<long long int, int>&'}
859 | upper_bound(const key_type& __x)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:863:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::const_iterator std::set<_Key, _Compare, _Alloc>::upper_bound(const key_type&) const [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::pair<long long int, int>, std::pair<long long int, int>, std::_Identity<std::pair<long long int, int> >, std::less<std::pair<long long int, int> >, std::allocator<std::pair<long long int, int> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = std::pair<long long int, int>]'
863 | upper_bound(const key_type& __x) const
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:863:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const key_type&' {aka 'const std::pair<long long int, int>&'}
863 | upper_bound(const key_type& __x) const
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:869:2: note: candidate: 'template<class _Kt> decltype ((std::set<_Key, _Compare, _Alloc>::iterator)(((std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_upper_bound_tr(__x))) std::set<_Key, _Compare, _Alloc>::upper_bound(const _Kt&) [with _Kt = _Kt; _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >]'
869 | upper_bound(const _Kt& __x)
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:869:2: note: template argument deduction/substitution failed:
books.cpp:42:57: note: couldn't deduce template parameter '_Kt'
42 | if(a <= (*s.upper_bound({sum - 1, 0})).fi + sum1 && (*s.upper_bound({sum - 1, 0})).fi + sum1 <= 2 * a)
| ^
In file included from /usr/include/c++/10/set:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
from books.cpp:1:
/usr/include/c++/10/bits/stl_set.h:875:2: note: candidate: 'template<class _Kt> decltype ((std::set<_Key, _Compare, _Alloc>::iterator)(((const std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_upper_bound_tr(__x))) std::set<_Key, _Compare, _Alloc>::upper_bound(const _Kt&) const [with _Kt = _Kt; _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >]'
875 | upper_bound(const _Kt& __x) const
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:875:2: note: template argument deduction/substitution failed:
books.cpp:42:57: note: couldn't deduce template parameter '_Kt'
42 | if(a <= (*s.upper_bound({sum - 1, 0})).fi + sum1 && (*s.upper_bound({sum - 1, 0})).fi + sum1 <= 2 * a)
| ^
books.cpp:42:65: error: 'sum1' was not declared in this scope
42 | if(a <= (*s.upper_bound({sum - 1, 0})).fi + sum1 && (*s.upper_bound({sum - 1, 0})).fi + sum1 <= 2 * a)
| ^~~~
books.cpp:42:101: error: no matching function for call to 'std::set<std::pair<long long int, int> >::upper_bound(<brace-enclosed initializer list>)'
42 | if(a <= (*s.upper_bound({sum - 1, 0})).fi + sum1 && (*s.upper_bound({sum - 1, 0})).fi + sum1 <= 2 * a)
| ^
In file included from /usr/include/c++/10/set:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
from books.cpp:1:
/usr/include/c++/10/bits/stl_set.h:859:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::upper_bound(const key_type&) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::pair<long long int, int>, std::pair<long long int, int>, std::_Identity<std::pair<long long int, int> >, std::less<std::pair<long long int, int> >, std::allocator<std::pair<long long int, int> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = std::pair<long long int, int>]'
859 | upper_bound(const key_type& __x)
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:859:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const key_type&' {aka 'const std::pair<long long int, int>&'}
859 | upper_bound(const key_type& __x)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:863:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::const_iterator std::set<_Key, _Compare, _Alloc>::upper_bound(const key_type&) const [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::pair<long long int, int>, std::pair<long long int, int>, std::_Identity<std::pair<long long int, int> >, std::less<std::pair<long long int, int> >, std::allocator<std::pair<long long int, int> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = std::pair<long long int, int>]'
863 | upper_bound(const key_type& __x) const
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:863:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const key_type&' {aka 'const std::pair<long long int, int>&'}
863 | upper_bound(const key_type& __x) const
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:869:2: note: candidate: 'template<class _Kt> decltype ((std::set<_Key, _Compare, _Alloc>::iterator)(((std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_upper_bound_tr(__x))) std::set<_Key, _Compare, _Alloc>::upper_bound(const _Kt&) [with _Kt = _Kt; _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >]'
869 | upper_bound(const _Kt& __x)
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:869:2: note: template argument deduction/substitution failed:
books.cpp:42:101: note: couldn't deduce template parameter '_Kt'
42 | if(a <= (*s.upper_bound({sum - 1, 0})).fi + sum1 && (*s.upper_bound({sum - 1, 0})).fi + sum1 <= 2 * a)
| ^
In file included from /usr/include/c++/10/set:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
from books.cpp:1:
/usr/include/c++/10/bits/stl_set.h:875:2: note: candidate: 'template<class _Kt> decltype ((std::set<_Key, _Compare, _Alloc>::iterator)(((const std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_upper_bound_tr(__x))) std::set<_Key, _Compare, _Alloc>::upper_bound(const _Kt&) const [with _Kt = _Kt; _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >]'
875 | upper_bound(const _Kt& __x) const
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:875:2: note: template argument deduction/substitution failed:
books.cpp:42:101: note: couldn't deduce template parameter '_Kt'
42 | if(a <= (*s.upper_bound({sum - 1, 0})).fi + sum1 && (*s.upper_bound({sum - 1, 0})).fi + sum1 <= 2 * a)
| ^
books.cpp:44:39: error: 'i' was not declared in this scope
44 | ans.push_back(i) ;
| ^
books.cpp:45:39: error: 'j' was not declared in this scope
45 | ans.push_back(j) ;
| ^
books.cpp:46:67: error: no matching function for call to 'std::set<std::pair<long long int, int> >::upper_bound(<brace-enclosed initializer list>)'
46 | ans.push_back((*s.upper_bound({sum - 1, 0})).se) ;
| ^
In file included from /usr/include/c++/10/set:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
from books.cpp:1:
/usr/include/c++/10/bits/stl_set.h:859:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::upper_bound(const key_type&) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::pair<long long int, int>, std::pair<long long int, int>, std::_Identity<std::pair<long long int, int> >, std::less<std::pair<long long int, int> >, std::allocator<std::pair<long long int, int> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = std::pair<long long int, int>]'
859 | upper_bound(const key_type& __x)
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:859:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const key_type&' {aka 'const std::pair<long long int, int>&'}
859 | upper_bound(const key_type& __x)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:863:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::const_iterator std::set<_Key, _Compare, _Alloc>::upper_bound(const key_type&) const [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::pair<long long int, int>, std::pair<long long int, int>, std::_Identity<std::pair<long long int, int> >, std::less<std::pair<long long int, int> >, std::allocator<std::pair<long long int, int> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = std::pair<long long int, int>]'
863 | upper_bound(const key_type& __x) const
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:863:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const key_type&' {aka 'const std::pair<long long int, int>&'}
863 | upper_bound(const key_type& __x) const
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:869:2: note: candidate: 'template<class _Kt> decltype ((std::set<_Key, _Compare, _Alloc>::iterator)(((std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_upper_bound_tr(__x))) std::set<_Key, _Compare, _Alloc>::upper_bound(const _Kt&) [with _Kt = _Kt; _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >]'
869 | upper_bound(const _Kt& __x)
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:869:2: note: template argument deduction/substitution failed:
books.cpp:46:67: note: couldn't deduce template parameter '_Kt'
46 | ans.push_back((*s.upper_bound({sum - 1, 0})).se) ;
| ^
In file included from /usr/include/c++/10/set:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
from books.cpp:1:
/usr/include/c++/10/bits/stl_set.h:875:2: note: candidate: 'template<class _Kt> decltype ((std::set<_Key, _Compare, _Alloc>::iterator)(((const std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_upper_bound_tr(__x))) std::set<_Key, _Compare, _Alloc>::upper_bound(const _Kt&) const [with _Kt = _Kt; _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >]'
875 | upper_bound(const _Kt& __x) const
| ^~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h:875:2: note: template argument deduction/substitution failed:
books.cpp:46:67: note: couldn't deduce template parameter '_Kt'
46 | ans.push_back((*s.upper_bound({sum - 1, 0})).se) ;
| ^