Explain the solution part

void calcsubarray(vector& x,int n, int c){
num=(1<<n);
for (int i=0; i<num; i++){
ll s = 1;
for (int j=0; j<n; j++){
if (i & (1<<j)){
if (a[j+c]>k/s){
s=-1;
break;
}
else s *= a[j+c];
}
}
if(s!=-1)x.push_back(s);
}
}

solution