G. Giá trị ở vị trí thứ k - 2


Submit solution

Points: 10
Time limit: 1.0s
Memory limit: 256M

Problem type

Cho dãy số sau 6, 7, 9 , 12 , 16....
Nhập vào số k, hãy in ra số ở vị trí thứ k trong dãy số trên

input

1

output

6

input

5

output

16

Gợi ý:

Tổng các số từ 1 đến n: 1 + 2 + 3 + 4+ ...+...n = n*(n+1)//2


Comments

There are no comments at the moment.