Hi!!
I tried solving this problem and for some random test cases it worked fine but, it is giving me a wrong answer when submitted.
can anyone tell me where did i go wrong…
#define ll long long int main() { ll t=0,p=0; cin>>p>>t; ll a[p],i=0; while(p--) cin>>a[i++]; while(t--) { ll q=0,val=0,n1=0; cin>>q; n1=q; for(ll i=n-1;i>=0;i--) { val=val+(ceil((long double)n1/a[i])); n1=(ceil((long double)n1/a[i])); } cout<< val; } return 0; }