P27885 [洛谷] [Information and Future 2015] Median Value
普及-
题目描述

Problem Description

Given a positive integer $n$, generate a sequence $a$ of length $n$ where $a_i = i$ for $1 \le i \le n$.

  • If $n$ is odd, output the median value of $a$ (the number located at the middle position of $a$).
  • If $n$ is even, output the sum of the two middle numbers of $a$.

Input Format

A single positive integer $n$.

Output Format

A single positive integer. If $n$ is odd, output the median value; if $n$ is even, output the sum of the two middle values.

Sample Input and Output

Sample Input #1

9

Sample Output #1

5

Sample Input #2

10

Sample Output #2

11

Notes

$1 \le n \le 10^{18}$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
9
样例输出
5