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.

Example

Input
3 1
Output
1 1
Input
2 3
Output
2 0
Input
7 3
Output
3 2

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.

 #include<bits/stdc++.h>
using namespace std;
int main()
{
int r,b;
while(~scanf("%d %d",&r,&b))
{
int maxn = max(r,b);
int minn = min(r,b);
maxn -= minn;
int c = maxn / ;
cout<<minn<<" "<<c<<endl;
}
return ;
}

Vasya the Hipster的更多相关文章

  1. Codeforces Round #322 (Div. 2) A. Vasya the Hipster 水题

    A. Vasya the Hipster Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/p ...

  2. cf581A Vasya the Hipster

    One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red so ...

  3. 【Henu ACM Round#19 A】 Vasya the Hipster

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟题. 两个一起用->min(a,b); 剩下的除2加上去就好 [代码] #include <bits/stdc++. ...

  4. Codeforces Round #322 (Div. 2)

    水 A - Vasya the Hipster /************************************************ * Author :Running_Time * C ...

  5. Milliard Vasya's Function-Ural1353动态规划

    Time limit: 1.0 second Memory limit: 64 MB Vasya is the beginning mathematician. He decided to make ...

  6. CF460 A. Vasya and Socks

    A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  7. 递推DP URAL 1353 Milliard Vasya's Function

    题目传送门 /* 题意:1~1e9的数字里,各个位数数字相加和为s的个数 递推DP:dp[i][j] 表示i位数字,当前数字和为j的个数 状态转移方程:dp[i][j] += dp[i-1][j-k] ...

  8. Codeforces Round #281 (Div. 2) D. Vasya and Chess 水

    D. Vasya and Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  9. Codeforces Round #281 (Div. 2) C. Vasya and Basketball 二分

    C. Vasya and Basketball time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

随机推荐

  1. 清除session信息

    session.removeAttribute("sessionname")是清除SESSION里的某个属性.     session.invalidate()是让SESSION失 ...

  2. React-Native(一):React Native环境搭建

    第一步:安装jdk 从java官网下载jdk8 配置环境变量: JAVA_HOME:D:\Program Files\Java\jdk1.8.0_111 Path中追加:%JAVA_HOME%\bin ...

  3. Spring源码情操陶冶-任务定时器ConcurrentTaskScheduler

    承接前文Spring源码情操陶冶#task:scheduled-tasks解析器,本文在前文的基础上讲解单核心线程线程池的工作原理 应用附例 承接前文的例子,如下 <!--define bean ...

  4. JavaScript实现轮播图(隔3秒显示一张图)

    <!DOCTYPE html><html> <head> <script> var time; function init(){ //获取div里面的东 ...

  5. Oracle中SQL调优(SQL TUNING)之最权威获取SQL执行计划大全

    该文档为根据相关资料整理.总结而成,主要讲解Oracle数据库中,获取SQL语句执行计划的最权威.最正确的方法.步骤,此外,还详细说明了每种方法中可选项的意义及使用方法,以方便大家和自己日常工作中查阅 ...

  6. glut 深度测试无不起作用问题解决

    OpenGL中使用glEnable(GL_DEPTH_TEST)后深度测试没有起作用,发现深度缓冲没有创建.glut库在兼容模式(GL_COMPATIBILITY_PROFILE)下displaymo ...

  7. [LeetCode] Sentence Similarity II 句子相似度之二

    Given two sentences words1, words2 (each represented as an array of strings), and a list of similar ...

  8. Python---老王开枪

    class Person(object): """人类""" def __init__(self,name): super(Person,s ...

  9. NOI2006 郁闷的出纳员

    题目描述 OIER公司是一家大型专业化软件公司,有着数以万计的员工.作为一名出纳员,我的任务之一便是统计每位员工的工资.这本来是一份不错的工作,但是令人郁闷的是,我们的老板反复无常,经常调整员工的工资 ...

  10. [USACO13OPEN]照片Photo

    题目描述 Farmer John has decided to assemble a panoramic photo of a lineup of his N cows (1 <= N < ...