My solution (I didn't verify uniqueness):
Here's generally how I solved it:
The first step was to place $6$, $13$, and $37$ (and then $38$). Then I looked at the square between $20$, $32$, and $36$. It must be odd, because otherwise one of the numbers above or below the $20$ would be a multiple of $4$. Checking every possibility doesn't actually take very long, and you can't go very far using any other number but $11$.
That gets you to
I made a couple of informed guesses, using the information that the $3$ and the $5$ can't be in the same group, that the $40$ must be part of a group summing to $100$, and similar things. Wrong guesses quickly lead to contradictions at this point.