[Buổi 1][Nhập môn][RDD] Bài 25: Tính tổng 4.


LÀM BÀI

Points: 10
Time limit: 2.0s
Memory limit: 20M

Author:
Problem types
Allowed languages
C++

Tính tổng 4.

Bối cảnh

Bài toán được mô tả qua yêu cầu và dữ liệu dưới đây.

Yêu cầu

Tính tổng sau: Sn = 2 + 4 + 6 + 8 + … + 2*n.

Input

Số nguyên dương n. ( 1 ≤ n ≤ 10^9).

Output

In ra đáp án bài toán.

Ràng buộc

Đề gốc không nêu ràng buộc riêng.

Ví dụ 1

Input

3

Output

12

Thông tin học tập

  • Buổi: B01
  • Concepts: variables, data types, cin/cout, arithmetic expressions
  • Giới hạn kiến thức: B01-B01
  • Time limit: 2 seconds
  • Memory limit: 20 MB
  • Point: 10

Comments

There are no comments at the moment.

Zalo