Why i am getting wrong answer

#include<bits/stdc++.h>
using namespace std;

/*long long gcd(long long a,long long b){

        return b==0?a:gcd(b,a%b);

}

unsigned int cnt_setb(unsigned int n ){

// unsigned int ans=0;

/*while(n){

    ans+=n&1;

    n=n>>1;
}

return ans;

if(n==0) return 0;

return (n&1)+cnt_setb(n>>1);

}

*/
int main(){

int t;

cin>>t;

int g,sum,p;

int vc[10];

        while(t--){

          sum=0;


                cin>>g>>p;


                for(int i=0;i<10;i++){

                    cin>>vc[i];

                }

                for(int i=9;i>g-1;i--){


                    sum+=vc[i]/p;

                    vc[i-1]+=vc[i]%p;


                }

                cout<<sum+1<<" ";


                cout<<sum+ceil(float(vc[g-1])/p)<<"\n";

}

return 0;

}

PROBLUM LINK