eolymp
bolt
Try our new interface for solving problems
Problems

Interschool network

Interschool network

For the organization of the center of distance education to all schools of the city had to combine conductive channels of communication pairs, and in each school all the wires that go to it, connect to each other. The channel is a conductor physically with resistance\textbf{ R}, and this quantity is the same for all the laid lines (it is not necessary to discuss the desirability - so decided to specialists). When connecting to each school, starting with the third, signalers measured resistance between each pair of schools connected to the network at this stage, using a very accurate digital ohmmeter. When all schools are connected, they felt, how many times the measurement results were an integer. Let it do, and your program. \InputFile The program reads the first integer \textbf{R} - the resistance between each pair of schools (\textbf{1 <= R <= 10000}), further - a positive integer \textbf{N }(\textbf{3 <= N <= 10000})\textbf{ }- the number of schools. Numbers are entered on one line through the gap. \OutputFile The program displays a single integer - the number of measurements in whole numbers.
Time limit 1 second
Memory limit 64 MiB
Input example #1
8 10
Output example #1
34
Source II этап Всеукраинской олимпиады школьников 2008-2009, г. Бердичев