A - Discount Fare


Time limit : 2sec / Memory limit : 1024MB

Score: 100 points

Problem Statement

There is a train going from Station A to Station B that costs X yen (the currency of Japan).

Also, there is a bus going from Station B to Station C that costs Y yen.

Joisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.

How much does it cost to travel from Station A to Station C if she uses this ticket?

Constraints

  • 1≤X,Y≤100
  • Y is an even number.
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

If it costs x yen to travel from Station A to Station C, print x.


Sample Input 1

Copy
81 58

Sample Output 1

Copy
110
  • The train fare is 81 yen.
  • The train fare is 58 ⁄ 2=29 yen with the 50% discount.

Thus, it costs 110 yen to travel from Station A to Station C.


Sample Input 2

Copy
4 54

Sample Output 2

Copy
31
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
using namespace std;
#pragma comment(linker, "/stck:1024000000,1024000000")
#define lowbit(x) (x&(-x))
#define max(x,y) (x>=y?x:y)
#define min(x,y) (x<=y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.1415926535897932384626433832
#define ios() ios::sync_with_stdio(true)
#define INF 1044266558
#define mem(a) (memset(a,0,sizeof(a)))
int main()
{
int x,y;
cin>>x>>y;
cout<<x+y/<<endl;
return ;
}

AtCoder Beginner Contest 113 A的更多相关文章

  1. AtCoder Beginner Contest 113 C

    C - ID Time limit : 2sec / Memory limit : 1024MB Score: 300 points Problem Statement In Republic of ...

  2. AtCoder Beginner Contest 113 D Number of Amidakuji

    Number of Amidakuji 思路:dp dp[i][j]表示经过(i, j) 这个点的方案数 然后一层一层地转移, 对于某一层, 用二进制枚举这一层的连接情况, 判断连接是否符合题意, 然 ...

  3. AtCoder Beginner Contest 113 B

    B - Palace Time limit : 2sec / Memory limit : 1024MB Score: 200 points Problem Statement A country d ...

  4. AtCoder Beginner Contest 100 2018/06/16

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

  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. 453. Minimum Moves to Equal Array Elements 一次改2个数,变成统一的

    [抄题]: Given a non-empty integer array of size n, find the minimum number of moves required to make a ...

  2. Hyperledger Fabric系统架构

  3. dev 官网

    https://www.devexpress.com/Support/Center/Example/Details/E1343 <%@ Page Language="C#" ...

  4. What’s the Difference Between a Value Provider and Model Binder?

    ASP.NET MVC 3 introduced the ability to bind an incoming JSON request to an action method parameter, ...

  5. delphi监控文件夹

    (****************************************** 文件和目录监控 当磁盘上有文件或目录操作时,产生事件 使用方法: 开始监控: PathWatch(Self.Ha ...

  6. 【转】ANDROID自定义视图——onMeasure,MeasureSpec源码 流程 思路详解

    原文地址:http://blog.csdn.net/a396901990/article/details/36475213 简介: 在自定义view的时候,其实很简单,只需要知道3步骤: 1.测量—— ...

  7. DataSet取值并保存在List集合中

    DBHelper db = new DBHelper(); //实例化DB类 string sql = "select * from student"; //虚构的sql语句 Da ...

  8. 「HNOI2013」切糕

    题目链接 戳我 \(Solution\) 对于这道题,我们首先来看看没有\(D\)这个约束的该如何做. 我们考虑构造最小割模型. 其实直接贪心就好了,选出每条路径上的最小值就好了(路径就是将每层的同一 ...

  9. nginx理解与配置

    准备: http服务器:①tomcat②apache③nginx(c语言开发) 文件系统:①mgfs ②mgbd:存储小文件 ③fastDFS:存储大文件.小文件,分布式文件系统 nginx是一种ht ...

  10. Kubernetes -- Server 部署

    1.  Node 节点配置文件 1.1 下载相关的软件 wget https://dl.k8s.io/v1.13.1/kubernetes-server-linux-amd64.tar.gz wget ...