```
class Solution {
public:
int sqrt(int x) {
if(x<=0) // x=0
return 0;
if(x<4){ // x=1,2,3
return 1;
}
int res = 2*sqrt(x/4);
if((res+1)*(res+1)<=x){
return res+1;
}
return res;
}
};
```

Input: 2147395600

Output: 46341

Expected: 46340

Why I can not pass this case?

can any one help me?

Thanks