a154: Specific summation
Tags :
Accepted rate : 61人/63人 ( 97% ) [非即時]
評分方式:
Strictly

最近更新 : 2022-08-18 02:49

Content

Given an interger n, try to find the sum of the sequence with following pattern:2-3 + 4-5 + 6 +...n

Input

An integer n

n >= 2

Output

an integer represent the answer

Sample Input #1
4
Sample Output #1
3
Sample Input #2
6
Sample Output #2
4
Sample Input #3
5
Sample Output #3
-2
測資資訊:
記憶體限制: 64 MB
不公開 測資點#0 (33%): 1.0s , <1K
不公開 測資點#1 (33%): 1.0s , <1K
不公開 測資點#2 (34%): 1.0s , <1K
Hint :
Tags:
出處:
[管理者:
kichan@g.pui... (陳嘉賢CHAN KA IN)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」