I don’t know where I am wrong. This is VACCINE1 problem.
below is the code please help me.
#include <bits/stdc++.h>
using namespace std;
int main(){
int d1,v1,d2,v2,p,day,temp;
cin>>d1>>v1>>d2>>v2>>p;
if(d1>d2){
temp = (p - (d1-d2)*v2);
day = ceil(temp/(float)(v1+v2)); //
cout<<day+(max(d1,d2))-1;
}
else if (d2>d1){
temp = (p - (d2-d1)*v1);
day = ceil(temp/(float)(v1+v2));
cout<<day+(max(d1,d2))-1;
}
else{
day = ceil(p/(float)(v1+v2));
cout<<day+d1-1;
}
return 0;
}