For Loop. Typical tasks




Task
Time limit: 1000 ms,
Memory limit: 256 Mb

For a given positive integer n≥2, calculate the sum 1 × 2 + 2 × 3 + ... + (n-1) × n. Output the answer in the form of a calculated expression and its value exactly as shown in the example.

Input: A natural number is entered.
Output: Output the answer to the problem.

Example
Input Output
1 4 1*2+2*3+3*4=20

Auto CHOOSE THE PROGRAMMING NECESSARY LANGUAGE!
Attach the program source file:
or enter the source code in the language:

Rules for designing programs and a list of errors during automatic task verification
           

Results: