Ivica invited all of his friends to a big party. A party without candy is no party at all.
Ivica is afraid the candy will run short, so he will not buy fewer than A pieces. His money is enough for at most B pieces. Not every friend will come, so Ivica does not know how many people the party will have. He therefore wants to buy an amount that can be split evenly in as many ways as possible. A split is even when every friend who takes part receives the same number of pieces and none of the candy is left over. For example, if Ivica buys 6 pieces, there are four even splits: 1+1+1+1+1+1, 2+2+2, 3+3, 6.
Write a program that tells Ivica how many pieces of candy to buy.