It's been a tiring day and Jack's hungry. His daughter calls him up and asks daddy to buy donuts on the way back. Instead of going to his favorite shop, Pi Donuts, Jack sees Sigma Donuts on the way instead, and decides to drop by.
'Five donuts please,' he says.
'That'll be 25 cents,' says the shopkeeper.
'Five cents per donut? That's pretty cheap,' says Jack, surprised. 'How do you even make money?'
The shopkeeper smiles. 'It's the big orders which get me the cash. The number of donuts I sell is always a one or two digit number, and besides, they're priced according to how many you buy.'
'So it would cost me differently based on how many donuts I buy?'
'Yup, it's a simple algebraic manipulation,' says the shopkeeper. 'You can do it yourself if I give you the number of donuts someone's buying. Like yesterday this woman ordered a couple dozen — actually, tell you what, I'll give 'em to you for free if you can guess what was the money I made from my biggest order yesterday. Just remember, the price per donut depends on how many donuts you buy.'
'Alright,' says Jack, thrilled.
'You have three questions.'
Jack thinks for a while.
'Is your price unique?' he asks. 'If I buy $x$ donuts and it costs $y$ per donut, then is there a unique $x$ for any chosen $y$?'
'No,' says the shopkeeper. 'A few values are unique, yes, but most aren't. The maximum number of times I use a value is ten, no more than that.'
'So the maximum number of values that $x$ can take for any given $y$ is ten?'
'Makes sense,' says Jack. 'What is the number of donuts you have to sell to make the most amount of money?'
'I make the most cash when someone buys 99 donuts, as it should be. But it's not necessary that the price is in ascending order — there do exist $x$ such that someone buying $x+1$ donuts makes me less money than someone buying $x$ donuts.'
'That's a terrible business strategy,' points out Jack. 'Then everyone will just buy $x+1$ donuts instead of $x$.'
'Well, we make do with what we have,' says the shopkeeper. 'No one's bought 99 donuts yet.'
'Okay,' says Jack, laughing at the shopkeeper's incompetence. 'Your biggest order yesterday - how many did you sell?'
The shopkeeper laughs. 'I'm not going to tell you that! But I can tell you this - two people came into the shop yesterday, and I charged them the same per donut. What's interesting, however, is that they actually bought a different number of donuts! Plus, if a third guy had come, to get the same price per donut, he'd have to buy the same number of donuts as one of the other two.'
Jack, being a perfect logician, determines the value within a minute.
Shopkeeper: ಠ ︵ ಠ
Jack goes home and has dinner with his family, and they all enjoy the donuts.
What was the number of donuts the shopkeeper sold in his biggest order, and how much money did he make from that order?
BONUS: How does the shopkeeper determine the price per donut given the number of donuts?