when i tried to solve subset problem i get wrong answer and i can't find unhandled
`
#include<algorithm>
#include<stdio.h>
using namespace std;
int n, a, b;
int nums[34];
vector<long long> left, right;
void solve(int stop, int index, int current, vector<long long> &sums) {
if (index == stop) {
sums.push_back(current);
return;
}
solve(stop, index + 1, current, sums);
solve(stop, index + 1, current + nums[index], sums);
}
int main() {
scanf("%d %d %d", &n, &a, &b);
for (int i = 0; i < n; ++i) {
scanf("%d", &nums[i]);
}
solve(n / 2, 0, 0, left);
solve(n, n / 2, 0, right);
sort(left.begin(), left.end());
long counter = 0;
for (int j = 0; j < right.size(); ++j) {
counter += (upper_bound(left.begin(), left.end(), b - right[j]) - left.begin()) -
(lower_bound(left.begin(), left.end(), a - right[j]) - left.begin());
}
printf("%ld\n", counter);
}`