[Python 3.8 (pre-release)]BRASCA, 18 bytes
Takes input as <3-par>,<4-par>,<5-par>,<difficulty>
Ci',G,3*$4*+$5*+$-
Explanation
C - Set implicit output to number mode
i',G - Use numbers instead of charcodes for 0-9. Then split by commas.
, - Reverse stack so the 3par is at the top.
3* - 3par * 3
$4*+ - 4par * 4, then add to 3par
$5*+ - 5par * 5, then add to total
$- - total - difficulty
<implicit> - Print it