Есть ответ 👍

Day, while researching the E5 measurement, Rick came up with the idea of ​​a device that would change humanity. Inhabitants of the E5 dimension once a millennium organize a big one-dimensional sea battle tournament. The device will perform the following task: help a participant in a one-dimensional sea battle tournament to place the maximum number of ships on the field. He has not yet decided how exactly he is going to change humanity with the help of his invention, but he is sure that he will be able, at least, to introduce the game in one-dimensional sea battle into our dimension and diversify people's lives. The field in a one-dimensional sea battle game has dimensions 1 × n . The task of the device is to find the maximum k such that one ship of size 1 × k , two ships of size 1 × ( k - 1) , ... , k ships of size 1 × 1 can be placed on the field , and the ships, as in a conventional sea fight, should not touch each other and intersect.

Input data
The only line of the input contains the number n - the number of cells in the field .

Output
Print a single number - the maximum k that you can arrange the ships, as described in the condition.

Example
input
7
output
2

Note
Explanation for the example: for a 1 × 7 field, the answer is 2. You can place one 1 × 2 ship and two 1 × 1 ( 2, 1, 1)

188
310
Посмотреть ответы 1

Ответы на вопрос:


Вид информации  по способу восприятия - зрительная (органами зрения человека)

Реши свою проблему, спроси otvet5GPT

  • Быстро
    Мгновенный ответ на твой вопрос
  • Точно
    Бот обладает знаниями во всех сферах
  • Бесплатно
    Задай вопрос и получи ответ бесплатно

Популярно: Информатика

Caktus Image

Есть вопросы?

  • Как otvet5GPT работает?

    otvet5GPT использует большую языковую модель вместе с базой данных GPT для обеспечения высококачественных образовательных результатов. otvet5GPT действует как доступный академический ресурс вне класса.
  • Сколько это стоит?

    Проект находиться на стадии тестирования и все услуги бесплатны.
  • Могу ли я использовать otvet5GPT в школе?

    Конечно! Нейросеть может помочь вам делать конспекты лекций, придумывать идеи в классе и многое другое!
  • В чем отличия от ChatGPT?

    otvet5GPT черпает академические источники из собственной базы данных и предназначен специально для студентов. otvet5GPT также адаптируется к вашему стилю письма, предоставляя ряд образовательных инструментов, предназначенных для улучшения обучения.

Подпишись на наш телеграмм канал

GTP TOP NEWS