I tried to get all 1000 candy after doing all of the scenes but it seems it's impossible. You end up ~100 candy short. So at most you either get all 1000 candy or all 100 lewdness.
Meanwhile... there is a way to get both
Pretty much have +900 candy and +100HP, get in one of the houses that would give you enough candy for it (better any of the last 2 ones) and use wine to get lewdness to 100. Since you aren't outside it won't trigger the lewd ending. Then ask for candy.
I don't recommend you do to it because Devil won't despawn from that position in the screenshot and Mary gets stuck walking into him, unable to finish the event. Sadly there is no way to know the ending you'd get like that and of course, it's not a 4th ending.