Codeforces Round 322 (Div. 2)
A
Vasya the Hipster
Codeforces
800
原题
←B →
翻译中…

One day Vasya the Hipster decided to count how many socks he had. It turned out that he had $*a*$ red socks and $*b*$ blue socks.

翻译中…

According to the latest fashion, hipsters should wear the socks of different colors: a red one on the left foot, a blue one on the right foot.

翻译中…

Every day Vasya puts on new socks in the morning and throws them away before going to bed as he doesn't want to wash them.

翻译中…

Vasya wonders, what is the maximum number of days when he can dress fashionable and wear different socks, and after that, for how many days he can then wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

翻译中…

Can you help him?

翻译中…

Input

翻译中…

The single line of the input contains two positive integers $*a*$ and $*b*$ ($1 ≤ *a*, *b* ≤ 100$) — the number of red and blue socks that Vasya's got.

翻译中…

Output

翻译中…

Print two space-separated integers — the maximum number of days when Vasya can wear different socks and the number of days when he can wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

翻译中…

Keep in mind that at the end of the day Vasya throws away the socks that he's been wearing on that day.

翻译中…

Note

翻译中…

In the first sample Vasya can first put on one pair of different socks, after that he has two red socks left to wear on the second day.

翻译中…

样例

Input #1
3 1
Output #1
1 1
InputCopy OutputCopy
Input #2
2 3
Output #2
2 0
InputCopy OutputCopy
Input #3
7 3
Output #3
3 2
InputCopy OutputCopy
题目信息
题号
581A
时间限制
1 s
内存限制
256 MB
标签
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。