Whats floating point exception?why this error


#1

struct pai
{
int a;
int index;
};

vector Solution::solve(int aa, vector &v)
{

vector<pai>s;
vector<int>ans;
int n=v.size();int small=v[0],k=0;
for(int i=1;i<n;i++)
{
    if(v[i]<small){ small=v[i];k=i;}
}
int maxi=aa/small;
int our=maxi*small;
our-=small;
for(int i=0;i<k;i++)
{
  if(our+v[i]<=aa)
  s.push_back({v[i],i});
}
our+=small;
s.push_back({small,k});
for(int i=0;i<s.size();i++)
{
    int say=our;int say2=(s[i].a)-small; 
    int times=(aa-say)/say2;
    for(int j=0;j<times;j++)
    {
        ans.push_back(s[i].index); our=our-small+s[i].a; 
    }
  
}
int now=aa-our;
for(int i=0;i<now/small;i++)ans.push_back(k);
    sort(ans.begin(),ans.end());
    return ans;

}