题目链接:https://abc082.contest.atcoder.jp/tasks/abc082_a

Time limit : 2sec / Memory limit : 256MB

Score : 100 points

Problem Statement

You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.

Constraints

  • a and b are integers.
  • 1≤a,b≤100

Input

Input is given from Standard Input in the following format:

a b

Output

Print x rounded up to the nearest integer.


Sample Input 1

Copy
1 3

Sample Output 1

Copy
2

The average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.


Sample Input 2

Copy
7 4

Sample Output 2

Copy
6

The average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.


Sample Input 3

Copy
5 5

Sample Output 3

Copy
5

 #include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b){
if((a+b)%==) cout<<(a+b)/<<endl;
else{
int c=(a+b)/;
if(a+b-*c<=) cout<<c+<<endl;
else cout<<c<<endl;
}
}
return ;
}

AtCoder Beginner Contest 082 A - Round Up the Mean的更多相关文章

  1. AtCoder Beginner Contest 082 B - Two Anagrams

    题目链接:https://abc082.contest.atcoder.jp/tasks/abc082_b Time limit : 2sec / Memory limit : 256MB Score ...

  2. AtCoder Beginner Contest 100 2018/06/16

    A - Happy Birthday! Time limit : 2sec / Memory limit : 1000MB Score: 100 points Problem Statement E8 ...

  3. AtCoder Beginner Contest 068 ABCD题

    A - ABCxxx Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement This contes ...

  4. AtCoder Beginner Contest 148 题解

    目录 AtCoder Beginner Contest 148 题解 前言 A - Round One 题意 做法 程序 B - Strings with the Same Length 题意 做法 ...

  5. AtCoder Beginner Contest 052

    没看到Beginner,然后就做啊做,发现A,B太简单了...然后想想做完算了..没想到C卡了一下,然后还是做出来了.D的话瞎想了一下,然后感觉也没问题.假装all kill.2333 AtCoder ...

  6. AtCoder Beginner Contest 053 ABCD题

    A - ABC/ARC Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Smeke has ...

  7. AtCoder Beginner Contest 136

    AtCoder Beginner Contest 136 题目链接 A - +-x 直接取\(max\)即可. Code #include <bits/stdc++.h> using na ...

  8. AtCoder Beginner Contest 137 F

    AtCoder Beginner Contest 137 F 数论鬼题(虽然不算特别数论) 希望你在浏览这篇题解前已经知道了费马小定理 利用用费马小定理构造函数\(g(x)=(x-i)^{P-1}\) ...

  9. AtCoder Beginner Contest 076

    A - Rating Goal Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Takaha ...

随机推荐

  1. linux 查看系统资源使用情况:vmstat

    vmstat命令可以动态地查看系统资源的使用情况,如内存/交换分区/CPU的使用情况,通过使用该命令可以判断系统的瓶颈在哪里: [root@mysql ~]# vmstat procs ------- ...

  2. RN九宫格

    九宫格可以用两种方式来做,一种使用SectionList,是我的另外一篇博客,还有一种的纯代码计算,下面是效果图 代码如下: var Dimensions = require('Dimensions' ...

  3. gitlab+jenkins多项目,多依赖,继承等上下级项目关系的自动部署

    案例: 现有三个项目,Common,entity,serviceAPIentity依赖于Common,serviceAPI依赖于entity,也就是说common的下级项目是entity,而entit ...

  4. MHA配置参数详解 【转】

    mha配置参数详解: 参数名字 是否必须 参数作用域 默认值 示例 hostname Yes Local Only - hostname=mysql_server1, hostname=192.168 ...

  5. shell字符串数组

    数组 声明数组 declare -a ARRAY_NAME declare -A ARRAY_NAME: 关联数组 注意:两者不可相互转换 数组名和下标(索引) 索引:编号从0开始,属于数值索引 注意 ...

  6. Windows 10正式版的历史版本

    1.Windows 10 1507 初版Windows 10,代号TH1,版本号10240,发布于2015年7月. 2015年7月29日,微软正式发布了Windows 10操作系统.Windows 1 ...

  7. NYOJ 棋盘覆盖

    数字很大,要用大数乘法. #include<iostream> #include<stdio.h> #include<string.h> #include<q ...

  8. Vue+typescript报错项

    39:1 Unable to resolve signature of class decorator when called as an expression. Type '<VC exten ...

  9. CentOS里alias命令

    alias命令 功能描述:我们在进行系统的管理工作一定会有一些我们经常固定使用,但又很长的命令.那我们可以给这些这一长串的命令起一个别名.之后还需要这一长串命令时就可以直接以别名来替代了.系统中已经有 ...

  10. 加载更多的ajax 字符串拼接

    https://www.cnblogs.com/52fhy/p/5405541.html