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.|

RGB7071 - Нийлбэр 2

Өгөгдсөн n тоо хүртэлх квадратуудын нийлбэрийг ол. Давталт ашиглахгүй болно.

12+22+...+n2

Input

n натурал тоо өгөгдөнө.

Output

Нийлбэр

Example

Input:
5

Output:
55

Нэмсэн:Bataa
Огноо:2013-01-06
Хугацааны хязгаарлалт: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
2021-02-11 05:06:08
#include <stdio.h>
main()
{int n;
scanf("%d", &n);
printf("%d", n*(n+1)*(2*n+1)/6);
}
code ntr gj kutsaj bhaar math bodoj sur hulgaichuud
2021-01-09 16:00:30
Leave a Comment
2020-10-25 16:11:08
2019-05-31 12:45:08
#include<stdio.h>
#include<string.h>
int main()
{
int a,b,c=0;
scanf("%d", &a);
for(b=1;b<=a;b++) {
c=c+b*b; }
printf("%d",c);
}
2020-10-25 15:48:22
davtalt ashiglahgui n bna shuuu zaluusa
2020-10-22 09:51:04
#include <iostream>
#include<math.h>
using namespace std;

int main() {
int a,b;
cin>>a;
for(int c=1; c<=a; c++){
b=b+[pow(c,2)];
}
cout<<b;



return 0;
}
ene nii yu ni bolohguu bgan
2020-05-12 08:32:36
printf("%d" , n * (n + 1) * (2 * n + 1) / 6);
2020-04-03 12:28:39
uursdu bodotsgo
2019-11-19 04:09:42
hooe bodson hun nm uu
2019-10-19 13:39:04
#include <cstdio>
int main()
{
int a;
scanf ("%d",&a);
int n=a*(a+1)*(2*a+1)/6;
printf ("%d",n);
return 0;
}
2019-10-10 14:43:18
HAH

Last edit: 2019-10-10 14:43:41
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.