103050: [Atcoder]ABC305 A - Water Station

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:9 Solved:0

Description

Score : $100$ points

Problem Statement

There is an ultramarathon course totaling $100\;\mathrm{km}$. Water stations are set up every $5\;\mathrm{km}$ along the course, including the start and goal, for a total of $21$.

Takahashi is at the $N\;\mathrm{km}$ point of this course. Find the position of the nearest water station to him.

Under the constraints of this problem, it can be proven that the nearest water station is uniquely determined.

Constraints

  • $0\leq N\leq100$
  • $N$ is an integer.

Input

The input is given from Standard Input in the following format:

$N$

Output

Print the distance between the start and the water station nearest to Takahashi, in kilometers, in a single line.


Sample Input 1

53

Sample Output 1

55

Takahashi is at the $53\;\mathrm{km}$ point of the course. The water station at the $55\;\mathrm{km}$ point is $2\;\mathrm{km}$ away, and there is no closer water station. Therefore, you should print $55$.


Sample Input 2

21

Sample Output 2

20

Takahashi could also go back the way.


Sample Input 3

100

Sample Output 3

100

There are also water stations at the start and goal. Additionally, Takahashi may already be at a water station.

Input

题意翻译

有一把长度 $1$ 米,分度值 $1$ 厘米的米尺。 为了方便,$0,5,10,15,\ldots,100$ 厘米刻度标成了红色。 问 $N$ 厘米刻度(**存在于这把米尺上**)距最近的红色刻度。

Output

分数:100分

问题描述

有一个全程为$100\;\mathrm{km}$的超级马拉松赛道。赛道沿线每$5\;\mathrm{km}$设有一个补水站,包括起点和终点在内共有$21$个补水站。

高桥在距离起点$N\;\mathrm{km}$的位置。求距离他最近的补水站的位置。

在本题的约束条件下,可以证明最近的补水站是唯一确定的。

输入

输入通过标准输入给出,格式如下:

$N$

输出

在一行内输出高桥和最近的补水站之间的距离,单位为千米。

样例输入 1

53

样例输出 1

55

高桥在距离起点$53\;\mathrm{km}$的位置。距离他最近的补水站在$55\;\mathrm{km}$处,且没有更近的补水站。因此,应该输出$55$。

样例输入 2

21

样例输出 2

20

高桥也可以回头走。

样例输入 3

100

样例输出 3

100

起点和终点也设有补水站。另外,高桥可能已经在一个补水站的位置了。

HINT

每5km一个站,最近的那个站在哪个位置?

加入题单

上一题 下一题 算法标签: