I know that at least for three of the last four puzzles, and also for the mario kart 7 one, I always spent a round number of coins, because I only had them to get.
MK7, Mario Tennis Open and NSMB2 all cost exactly 200 play coins to get all 32 blue pieces. KIU cost 150.
The only exception was Kirby 20th. That was 186.
Ignoring the last one, I dont know of the rounded-to-50 figure was just coincidence, but I kind of figured the algorithm used a total of the number of coins they wanted you to spend then allocated a new piece at specific markers or percentages of that number or something.
I may be totally off...