We know, force is indirectly proportional to square of distance
F directly proportional 1/r²
You halved the distance [ from 10 to 5 ]
New Force with 5 cm would be: = F'
F' = 1/(r/2)² = 4/r² = 4.F [ As we have: F = 1/r²]
F' = 4F
F' = 4×10 = 40 N
In short, Your Answer would be 40 Newtons
Hope this helps!