题目链接: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. AppState使用

    AppState使用 import React, { Component } from 'react'; import {AppRegistry,StyleSheet,Text,View,AppSta ...

  2. vue 手指长按触发事件

    按钮 <span class="btn" @touchstart="gtouchstart()" @touchmove="gtouchmove( ...

  3. mysql 远程登录 设置

    1.在服务器上通过命令行或客户端登录mysql:2.执行以下sql:GRANT ALL PRIVILEGES ON 开放权限的数据库.* TO 用户名@"%" IDENTIFIED ...

  4. EOS 帐户权限操作--你找不到的干货 (原创) 续集-EOS 3.0

    https://eosfans.io/topics/372 关于2.0权限问题请移步https://eosfans.io/topics/28 目录 查看权限 改变权限 增加权限 删除权限 查看权限 有 ...

  5. component 理解

    1: sap中的component理解 component分为 genil component 和ui component component相当于整个应用中某一小块的前台/后台所有的东西都包括进去. ...

  6. 继承:继承后子类构造函数具有隐式super,所以子类中所以的构造函数默认会访问父类中的空参数的构造函数

    class Test { Test(){ System.out.println("Test"); } Test(String name){ System.out.println(& ...

  7. git 不区分文件大小写的处理

  8. CentOS6.5 安装Kafka集群

    1.安装zookeeper 参考文档:http://www.cnblogs.com/hunttown/p/5452138.html 2.下载:https://www.apache.org/dyn/cl ...

  9. Amber learning note A8: Loop Dynamics of the HIV-1 Integrase Core Domain

    1. Prepare Input File $ tleap >source leaprc.protein.ff14SB ----- Source: /home/wangq/Programs/am ...

  10. Java之网络编程

    1.网络编程的基本概念 1.1 网络的概念 网络:一组相互连接的计算机,多台计算机组成,使用物理线路进行连接 1.2 网络连接的功能 1.3 网络编程的三要素 1) IP 地址:唯一标识网络上的每一台 ...