For n = (x^2+x)/2, f(n) = x^2+x-2n.Then with Newton Method , x(n+1) = x(n) - f(n)/f'(n), It's x(n+1) = x(n) - (x^2+x+2n)/2x+1 = (x^2 + 2n) / 2x. Help me , thx.

```
public:
int arrangeCoins(int n) {
int x = 1;
unsigned long long tn = n<<1;
while(x*(x+1) < tn){
x = (x*x+tn)/(2*x+1);
}
return (int)x-1;
}
}; ```
```