Vasya the Hipster

题意翻译

一天,嬉皮士瓦西娅决定数一数他有多少只袜子。原来他有一双红袜子和一双蓝袜子。根据最新的流行趋势,潮人应该穿不同颜色的袜子:左脚穿红色的袜子,右脚穿蓝色的袜子。每天早上,瓦西娅穿上新袜子,在睡觉前把它们扔掉,因为他不想洗它们。瓦西娅想知道,他能穿不同的袜子穿时髦的衣服的最长天数是多少天,在那之后的几天里,他可以穿同样的袜子,直到他的袜子用完或者不能用他的袜子做一双。你能帮他吗? 输入的单行包含两个正整数a和b(1<=a,b<=1001<=a,b<=100)-即Vasya得到的红色和蓝色袜子的数目。 输出两个空格分隔的整数-Vasya可以穿不同的袜子的最大天数和他可以穿同样的袜子的天数,直到他的袜子用完或者不能从他的袜子中制造出一双袜子时为止。请记住,在一天结束时,瓦西娅扔掉了他那天穿的袜子。 注意:在一天结束时,瓦西娅扔掉了他那天穿的袜子

题目描述

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?

输入输出格式

输入格式


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.

输出格式


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.

输入输出样例

输入样例 #1

3 1

输出样例 #1

1 1

输入样例 #2

2 3

输出样例 #2

2 0

输入样例 #3

7 3

输出样例 #3

3 2

说明

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.