A. Rounding
 
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Vasya has a non-negative integer n. He wants to round it to nearest integer, which ends up with 0. If n already ends up with 0, Vasya considers it already rounded.

For example, if n = 4722 answer is 4720. If n = 5 Vasya can round it to 0 or to 10. Both ways are correct.

For given n find out to which integer will Vasya round it.

Input

The first line contains single integer n (0 ≤ n ≤ 109) — number that Vasya has.

Output

Print result of rounding n. Pay attention that in some cases answer isn't unique. In that case print any correct answer.

Examples
input
5
output
0
input
113
output
110
input
1000000000
output
1000000000
input
5432359
output
5432360
Note

In the first example n = 5. Nearest integers, that ends up with zero are 0 and 10. Any of these answers is correct, so you can print 0 or 10.

代码:

 #include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
int main(){
ll n;
while(~scanf("%lld",&n)){
ll temp=n%;
if(temp>)n=n-temp+;
else n=n-temp;
printf("%lld\n",n);
}
return ;
 
 
 

Codeforces 898 A. Rounding的更多相关文章

  1. CodeForces 779B Weird Rounding

    简单题. 删去结尾的不是$0$的数字,保证结尾连续的$k$个都是$0$,如果不能做到,就保留一个$0$. #include<map> #include<set> #includ ...

  2. Codeforces 898 C.Phone Numbers-STL(map+set+vector)

    C. Phone Numbers   time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  3. Codeforces 898 B.Proper Nutrition

    B. Proper Nutrition   time limit per test 1 second memory limit per test 256 megabytes input standar ...

  4. Codeforces 898 B(拓展欧几里得)

    Proper Nutrition 题意:有n元钱,有2种单价不同的商品,是否存在一种购买方式使得钱恰好花光,如果有输入任意一种方式,如果没有输出“NO” 题解:可以使用拓展欧几里得快速求解. #inc ...

  5. Codeforces 898 贪心关闭最少闹钟 优先队列最少操作构造N/2squares 讨论情况哈希数字串分割a+b=c

    A /* Huyyt */ #include <bits/stdc++.h> #define mem(a,b) memset(a,b,sizeof(a)) #define mkp(a,b) ...

  6. Codeforces #402

    目录 Codeforces #402 Codeforces #402 Codeforces 779A Pupils Redistribution 链接:http://codeforces.com/co ...

  7. CF&&CC百套计划3 Codeforces Round #204 (Div. 1) A. Jeff and Rounding

    http://codeforces.com/problemset/problem/351/A 题意: 2*n个数,选n个数上取整,n个数下取整 最小化 abs(取整之后数的和-原来数的和) 先使所有的 ...

  8. Codeforces Round #204 (Div. 2)->C. Jeff and Rounding

    C. Jeff and Rounding time limit per test 1 second memory limit per test 256 megabytes input standard ...

  9. CodeForces 352C. Jeff and Rounding(贪心)

    C. Jeff and Rounding time limit per test:  1 second memory limit per test: 256 megabytes input: stan ...

随机推荐

  1. pyautogui 模块学习

    在日常实施中,我们用控件对大部分的网页和客户端都能进行拾取操作.但是仍有一小部分的应用无法进行操作.这里我常用到 pyautogui 这个模块.下面做个分享. Python 的 pyautogui 模 ...

  2. datagrid的增加功能的实现

    一.增加 1.行编辑状态所需的条件 (1)在columns中添加editor,注意type的设置 (2)调用beginEdit方法,开启行编辑 添加到第一行: 添加到最后一行: (2)如果有一行开启了 ...

  3. Vs2012 打开项目 自动关闭 并停止工作 解决方法

    来源:http://q.cnblogs.com/q/52530/ http://www.microsoft.com/zh-cn/download/details.aspx?id=36020 下载并安装 ...

  4. Python框架之Django学习笔记(一)

    Django历史: Django 是从真实世界的应用中成长起来的,它是由 堪萨斯(Kansas)州 Lawrence 城中的一个 网络开发小组编写的. 它诞生于 2003 年秋天,那时 Lawrenc ...

  5. phpMyAdmin 4.7.x CSRF

    phpMyAdmin 4.7.x CSRF 场景:管理员登陆phpmyadmin之后,我试验了一下,发现只要是登陆session没有失效应该是都可以的, 利用,phpmyadmin可以通过get方式操 ...

  6. 【转】超简单利用UGUI制作圆形小地图

    http://sanwen.net/a/ithhtbo.html 由于UI都是Achor自己用PS做的,比较粗糙,大家见谅,不过丝毫不影响功能的实现,下面我们看看今天的笔记: 首先我们看看需要哪些组件 ...

  7. ruby linux连接windows执行dos命令

    在整个开发流程中,gitlab-runner-ci是搭建在linux下.web自动化是在windows下面进行的. 如果ci构建完版本.部署完后,需要触发启动自动化执行. 那么我们需要在部署完后在li ...

  8. The following signatures couldn't be verified because the public key is not available 解决方法

    今天试图把 deepin 的软件源加到我到 Ubuntu 16.04 中去. 在 deepin wiki 上看到一个教程. 在 /etc/apt/sources.list 中加上 deepin 的软件 ...

  9. set和dict

    dict属于mapping类型 from collections.abc import Mapping,MutableMapping from collections.abc import __all ...

  10. T-SQL获取同类型数据不足补全的方法

    业务规则:如果有本地区的招聘会,显示本地区,如果没有本地区的招聘会,显示最近一场. 一条SQL搞定: [userId],[meetsName],[provinceId], [province],[ci ...