Implement int sqrt(int x)