[BOJ 9713] Sum of Odd Sequence

View as PDF

Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 128M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Given an odd integer N, calculate the sum of all the odd integers between 1 and N inclusive.

입력 형식

First line of the input contains T, the number of test cases. Each test case contains a single integer N. N is between 1 and 100.

출력 형식

For each test case output the value 1+3+….+N.

예제 입력

10
1
3
5
7
9
11
13
15
17
19

예제 출력

1
4
9
16
25
36
49
64
81
100

Comments

There are no comments at the moment.