My code for http://codeforces.com/contest/581/problem/C is giving wrong output and I am unable to find where my logic is incorrect

```
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
long long int n,k,i;
float a[100];
long int sum;
float total=0.0;
cin>>n>>k;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)//I am just skipping that values whose values are 100 while I am adding 1 to every array value untill it reaches 100 or K reduces to 0
{
if(a[i]==100)
continue;
else
{
while(k>=0)
{
if(a[i]!=100)
{
k--;
a[i]=a[i]+1.00;
}
}
}
}
for(i=0;i<n;i++)
{
total=total+(a[i]/10); //Calculating total
}
total=floor((double)(total));
sum=total;
cout<<sum;
return 0;
}
```