How much candy can you eat? Credit to Geobits in TNB for the idea

A post without sufficient detail recently posited an interesting game:

2 children sit in front of an array of candy. Each piece of candy is numbered 1 to x, with x being the total amount of candy present. There is exactly 1 occurrence of each number.

The goal of the game is for the children to eat candy and multiply the values of the candy they have eaten to arrive at a final score, with the higher score winning.

However the original post missed key information, such as how candy is selected, so the kids in our story decided that the older kid gets to go first, and can eat up to half the candy, however once he announces the end of his turn, he can't change his mind.

One of the kids in this game doesn't like candy, so he wants to eat as little as possible, and he once watched his dad write some code once, and figures he can use the skills gained from that to work out how much candy he needs to eat to ensure victory, whilst still eating as little as possible.

The Challenge

Given the total number of candy x, your program or function should output the smallest amount of candy he has to eat to ensure victory, n, even if his opponent eats all the remaining candy.

Naturally bigger numbers make bigger numbers, so whatever amount you'll give him, he'll eat the n largest numbers.

The Rules


x will always be a positive integer in the range 0 &lt; x! &lt;= l where l is the upper limit of your language's number handling capabilities
It is guaranteed that the kid will always eat the n largest numbers, for example for x = 5 and n = 2, he will eat 4 and 5


Test cases

x = 1
n = 1
(1 &gt; 0)

x = 2
n = 1
(2 &gt; 1)

x = 4
n = 2
(3 * 4 == 12 &gt; 1 * 2 == 2)

x = 5
n = 2
(4 * 5 == 20 &gt; 1 * 2 * 3 == 6)

x = 100
n = 42
(product([59..100]) &gt; product([1..58]))

x = 500
n = 220
(product([281..500]) &gt; product([1..280]))


Scoring

Unfortunately, our brave contestant has nothing to write his code with, so he has to arrange the pieces of candy into the characters of the code, as a result, your code needs to be as small as possible, smallest code in bytes wins!
Python 3, 76 bytes



F=lambda x:x&lt;2or x*F(x-1)
f=lambda x,n=1:x&lt;2or n*(F(x)&gt;F(x-n)**2)or f(x,n+1)


Try it online!

Relies on the fact that for eating \$n\$ candies to still win and the total number of candies being \$x\$, \$\frac{x!}{(x-n)!}&gt;(x-n)!\$ must be true, which means \$x!&gt;((x-n)!)^2\$.

-1 from Skidsdev

-3 -6 from BMO

-3 from Sparr

+6 to fix x = 1