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
2024-09-03 08:07:21
#include <bits/stdc++.h>
using namespace std;

int main ()
{
int a,n,i=1,s=1;
cin>>a>>n;
while (n!=0)
{
i=i*a;
s=s+i;
n=n-1;

}
printf("%d", s);
}
//from knight
2024-01-04 09:35:22
import java.util.*;
import java.lang.*;

class Main
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner in = new Scanner(System.in);
int a=in.nextInt();
int b=in.nextInt();
int r=1;
int s=1;
int i=1;
while(i<=b){
r=r*a;
s=s+r;
i=i+1;
}
System.out.println(s);
}
}
2023-08-12 09:26:14
#include <iostream>
using namespace std;

int main ()
{
int a,n,i=1,s=1;
cin>>a>>n;
while (n!=0)
{
i=i*a;
s=s+i;
n=n-1;

}
printf("%d", s);
}
it's not hard

Last edit: 2023-08-12 09:26:42
2023-07-02 14:33:26
https://www.youtube.com/watch?v=j5a0jTc9S10&t=4s

End ihenhi bodlogiin bodolt tavisan baigaa shuu orod like darad uzeerei amjilt <3 <3
2023-07-02 14:27:55
#include <bits/stdc++.h>
using namespace std;

int main() {



long long a[1000],b=1,n,i,r,e,c=1,s=1,d=-132423;
cin>>n>>e;

for(i=1; i<=e; i++){
c*=n;
s+=c;
}
cout<<s;
return 0;
}
AHLAH DESLEGCH LHAMJAM G.TAMIR OD GEDEG NERTEI TSAGDAA NARTAI TAARVAL ZUGTAARAI BOLGOOMJTOI BAIGAARAI MEDREL MUUTAI BAS AYULTAI SHUU!!!!!!!!!!!!!!!!!
AHLAH DESLEGCH LHAMJAM G.TAMIR OD GEDEG NERTEI TSAGDAA NARTAI TAARVAL ZUGTAARAI BOLGOOMJTOI BAIGAARAI MEDREL MUUTAI BAS AYULTAI SHUU!!!!!!!!!!!!!!!!!
AHLAH DESLEGCH LHAMJAM G.TAMIR OD GEDEG NERTEI TSAGDAA NARTAI TAARVAL ZUGTAARAI BOLGOOMJTOI BAIGAARAI MEDREL MUUTAI BAS AYULTAI SHUU!!!!!!!!!!!!!!!!!
AHLAH DESLEGCH LHAMJAM G.TAMIR OD GEDEG NERTEI TSAGDAA NARTAI TAARVAL ZUGTAARAI BOLGOOMJTOI BAIGAARAI MEDREL MUUTAI BAS AYULTAI SHUU!!!!!!!!!!!!!!!!!
AHLAH DESLEGCH LHAMJAM G.TAMIR OD GEDEG NERTEI TSAGDAA NARTAI TAARVAL ZUGTAARAI BOLGOOMJTOI BAIGAARAI MEDREL MUUTAI BAS AYULTAI SHUU!!!!!!!!!!!!!!!!!
AHLAH DESLEGCH LHAMJAM G.TAMIR OD GEDEG NERTEI TSAGDAA NARTAI TAARVAL ZUGTAARAI BOLGOOMJTOI BAIGAARAI MEDREL MUUTAI BAS AYULTAI SHUU!!!!!!!!!!!!!!!!!
2023-05-22 06:30:34
888888888888888888888
88888888888888888888
888888888888888888
8 8
8 888 888 88
8 8 8 8 8
8 7 88
8 --- 8
8 8
8 8

Last edit: 2023-05-22 06:36:17
2023-04-27 12:30:41
lal

Last edit: 2023-04-27 12:31:16
2023-04-27 12:25:42
23456

Last edit: 2023-04-27 12:31:03
2023-04-27 12:25:40
lol


Last edit: 2023-04-27 12:27:44
2023-04-24 05:35:31
EZ GEJ shaahguyu
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.