How to handle the large data set of the following problem of codejam 2013.?

https://code.google.com/codejam/contest/2418487/dashboard#s=p0

what i did was just using this function for discrete binary search, thinking it would pass :

```
bool check(int x)
{
return ((2*x + 2*r -1)<=(t/x));
}
```

where x is the mid we calculate in binary function.