eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

Planting Tree

Planting Tree

Novel-Supertv Digital TV Technology Co., Ltd is one of the leading digital TV technology solution providers in China. Novel-Supertv offers customized solutions for cable, satellite, terrestrial, IPTV, and handset TV networks. We often hold some competitions, games and other activities, like playing ping pang ball, basket ball, climbing mounting, live battle CS and so on. Last year we organized a planting tree activity, a colleague think out a very interesting question. The question is: There are \textbf{N} (\textbf{N} ≥ \textbf{2}) trees, you can plant into several lines. If a line have and only have \textbf{M} (\textbf{2} ≤ \textbf{M} ≤ \textbf{N}) trees, we called it "\textbf{M} trees line". We wonder the maximum lines of "\textbf{M} trees line" that it can be planted with the \textbf{N} trees. Now, can you make a program and tell us the answer? For example: \includegraphics{https://static.e-olymp.com/content/71/713660a628a48189a2fcbf31afe93d95be3034b1.jpg} \InputFile The input contains several lines. Each line contains two integer \textbf{N} and \textbf{M} separating with several blank characters (\textbf{2}≤ \textbf{N} ≤ \textbf{10}, \textbf{2} ≤ \textbf{M} ≤ \textbf{N}). \OutputFile For each input line, you should output a line contains the maximum lines of "\textbf{M} trees line" that it can be planted.
Лимит времени 1 секунда
Лимит использования памяти 64 MiB
Входные данные #1
3 2
4 2
4 3
Выходные данные #1
3
6
1
Источник Hunan University 2011 the 7th Programming Contest