Skip to content

Learning path · Programming Foundations with Python

Back to lesson · Loops

짝수합 출력하기

Unrated
한국어

Language

Contribute a translation
Time limit
1000 ms
Memory limit
256 MB
Submissions
2
Correct
2
Solved by
2
AC rate
100.000%

Statement

정숫값 하나를 전달받아 1부터 그 수까지의 정숫값 중 짝수만 합한 결과를 반환하는 함수 g()를 설계하고, 반환된 값을 출력하시오.

Input

첫째 줄에 정수 $n$이 주어진다. ($1 \le n \le 100\,000$)

Output

1부터 $n$까지의 정수 중 짝수의 합을 한 줄에 출력한다.

Examples

Sample input 1
10
Sample output 1
30
Sample input 2
1
Sample output 2
0

Tags

No tags yet