My issue
what’s exacctly wrong with my code? i checked the other submissions and my code is almost same as theirs. so why its not getting accepted?
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
long long int h,x,y1,y2,k;
cin>>h>>x>>y1>>y2>>k;
long long gun = ceil(h/(float)x);
long long laser;
long long remainedh = h-(k*y1);
if(remainedh<=0) laser = ceil(h/(float)y1);
else laser = k+ ceil(remainedh/(float)y2);
long long ans = min(gun,laser);
cout<<ans;
cout<<endl;
}
return 0;
}
### My code
include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t–){
long long int h,x,y1,y2,k;
cin>>h>>x>>y1>>y2>>k;
long long gun = ceil(h/(float)x);
long long laser;
long long remainedh = h-(k*y1);
if(remainedh<=0) laser = ceil(h/(float)y1);
else laser = k+ ceil(remainedh/(float)y2);
long long ans = min(gun,laser);
cout<<ans;
cout<<endl;
}
return 0;
}
````Preformatted text`
Problem Link: https://www.codechef.com/problems/WEPCH