Background:
I often find that, when browsing a Stackexchange site, I begin to wonder how people get the amount of reputation that they have. I know I can always count on codegolf SE to solve my problems, so here it is:
Create a program that will accept a positive integer which represents a person's reputation. We will ignore bounties, and say that these are the only ways to gain/lose rep on SE (full table here):
- Every account starts out with 1 rep and cannot go below that
- Your question is upvoted = +5
- Your answer is upvoted = +10
- Your question is downvoted = -2
- Your answer is downvoted = -2
- You downvote an answer = -1
- Your answer is accepted = +15
- You accept an answer = +2
Your program must figure out how many of those actions occurred on that user's account to get to the rep they have. It must figure out the shortest number of actions to get to this level of rep. Examples:
Input: 11 Output: 1 answer upvote
Input: 93 Output: 6 answer accepts, 1 answer accepted
In these examples when I say 'question upvote', it means that person's queston got upvoted. When I say 'answer downvoted', it means they downvoted someone else's answer.
Rules:
code-golf, so the shortest code that can do this wins.