Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7215 - Үржвэр нийлбэр 3

1*2+3*4+5*6+...+(n-1)*n нийлбэрийг ол.

Input

Натурал тэгш тоо өгөгдөнө.

Output

Нийлбэр.

Example

Input:
6

Output:
44

Нэмсэн:Bataa
Огноо:2013-01-21
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2019-10-30 05:47:13
#include <iostream>
using namespace std;

int main() {

int n;
cin >> n;
int sum = 0;
int m, j=1;
for ( int i=2; i <= n; i += 2 ){
m = (j * i);
sum += m;
j += 2;
}
cout << sum << endl;

return 0;
}
2019-10-16 10:05:24
burro l bshd sugaa



2019-08-18 21:24:20
#include <iostream>
using namespace std;

int main() {

int n;
cin >> n;
int sum = 0;
int m, j=1;
for ( int i=2; i <= n; i += 2 ){
m = (j * i);
sum += m;
j += 2;
}
cout << sum << endl;

return 0;
}
2019-04-03 10:15:18
jingooo
2019-02-26 12:48:20
#include <cstdio>
int main()
{
int a;
scanf ("%d",&a);
int b=(a-1)*(a)*(a+1)/3;
printf("%d",b);
return 0;
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.