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

RGB7218 - Зэрэгтүүдийн нийлбэр

Өгөгдсөн a тооны өгөгдсөн n тоо хүртэлх зэрэгтүүдийн нийлбэрийг ол. 1+a1+a2+a3+...+an.

Input

Нэг мөрөнд a, n натурал тоонууд зайгаар тусгаарлагдан өгөгдөнө.

Output

Зэрэгтүүдийн нийлбэр.

Example

Input:
3 5

Output:
364

Нэмсэн: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
2022-05-26 02:02:04
ez
2022-05-26 02:02:04
ez
2022-05-26 02:02:04
ez
2022-05-26 02:02:04
ez
2022-05-26 02:02:04
ez
2022-05-20 04:56:01
deez nutz
2022-03-31 10:28:24
#include<stdio.h>
#include<math.h>
int main()
{
int n, i, m, k=0, p;
scanf("%d", &m);
scanf("%d", &n);
for(i=1; i<=n; i++)
k=k+pow(m,i);
p=k+1;
printf("%d",p);

return 0;
}




boldoo gangggg




chingiss gangggg
2022-01-23 08:47:25
#include<stdio.h>
#include<math.h>
int a,b=1,c,d=0,n;
int main()
{
scanf("%d %d",&a,&n);
while(b<=n){
c=pow(a,b);
d=d+c;
b++;
}
printf("%d",d+1);
return 0;


}
for hereggua hoorhnude hahha
tugsu ah ni bn
2021-08-05 05:49:33
#include <iostream>
#include<math.h>
using namespace std;

int main() {

// your code here
int a,n,m,s;
scanf("%d%d",&a,&n);
s=(pow(a,n+1)-1)/(a-1);
printf("%d",s);

return 0;
}ez
2020-01-29 10:25:34
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int a,n,i,s=0,I;
cin>>a>>n;
for(i=0;i<=n;i++){
s=s+pow(a,i);}
cout<<s<<endl;}


© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.