One Test case failing

one test case failing please check

include<bits/stdc++.h>

using namespace std;

long long findValue(double p){

return ceil(sqrt(2*365*log(1/(1-p))));

}

int main() {

double i;
cin>>i;
cout<<findValue(i);
return 0;

}

hey @souravmunjal2000,when probability is 1 you cannot calculate its log (since1/(1-p) will become not define) hence use your findVal function only when p!=1 and direct print 366 for p=1.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.