Test case problem

i have tried this problem and getting the same output as given in sample. but one test case is showing wrong answer. can u tell me how to rectify this code ?

@Raghavsingla522,
Don’t use int, use double and them print integer part after calculating everything.

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.

i have changed double in place of but still one test case is showing wrong answer. can u tell the mistake so that it can pass all the test cases?

@Raghavsingla522,
You are calculating sqrt(D) without out checking whether D>=0 or not.

ya finally understood thanks