ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Camp. Turkey > задача:


Herons

Задачи сборника

• A+B
• Herons
• Workshop
• City Tour
• A Palace with Many Columns
• Nameplates
• Cycle detection
• Cities and roads
• Adjacency matrix to edges list
• Edges list to Adjacency matrix

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 1000/1000/1000/1000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

Problem description

Peter and Mary came to the zoo. Peter liked the most herons. He was impressed by their ability to sleep on one leg.

All herons are enclosed in one area. Some of them sleep on one leg and the other one is invisible, some on both. Peter counted number of legs he could see and got a legs. After a while Mary did the same thing and she got b legs. Some of herons could change their position by that time.

When they came home they decided to calculate number of herons in zoo. Soon they realised that not always it could be determined uniquely. So now they want to know minimum and maximum number of herons they've seen.

Input

The first line contains two integers a and b (1≤ a, b ≤ 109).

Output

Print minimum and maximum number of herons if there is always a solution.

Example

stdin stdout

3 4

2 3

Для отправки решений необходимо выполнить вход.

www.contester.ru