```
int sqrt(int x) {
if(x == 0 || x == 1){
return x;
}
int l = 1, r = x, res;
while(l <= r){
int m = (l + r)/2;
if(m == x / m){
return m;
}else if(m > x / m){
r = m - 1;
}else{
l = m + 1;
res = m;
}
}
return res;
}
```

My question is:

If using `if(m * m == x)`

instead of `if(m == x / m)`

(and `if(m * m > x)`

instead of `if(m > x / m)`

), I will get "Time Limit Exceeded" on case 2147395599. Why that happens?

Thank you in advance!