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

RGB7608 - Энгийн дараалал

a0 = a1 = 1, a2n = an ­+ an-1, a2n+1 = an – an-1 томьёогоор өгөгдсөн дарааллын n-р гишүүнийг ол.

Input

Натурал тоо n өгөгдөнө. 1<=n<=1000.

Output

Дарааллын n-р гишүүн.

Example

Input:
11

Output:
-2

Нэмсэн:Bataa
Огноо:2013-01-24
Хугацааны хязгаарлалт: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
2023-06-15 06:25:31
#include <iostream>

using namespace std;
int main(){

int a,c;
cin>>a;
int b[a];
b[1]=1;
b[0]=1;
for(int i=1; i<=a/2; i++){

b[i*2]=b[i]+b[i-1];
b[i*2+1]=b[i]-b[i-1];
}
cout<<b[a];
return 0;}
2023-03-13 14:31:55
huulj av


















































































































.




...

.

.
.































































































































































































































































olon ym be


































































































































































































boirtoi
2023-03-13 14:31:49
Ene bataa ene yamar lalriin bodlogo be muu































































































































































































































































































































































































































P''a ve chi hah
2023-01-09 12:35:04
#include<iostream>
using namespace std;
int main()
{
int i,a[10000],n;
cin>>n;
a[0]=1;
a[1]=1;
for(int i=2;i<=n;i++)
{
if(i%2==0){a[i]=a[i/2]+a[i/2-1];}
else {a[i]=a[(i-1)/2]-a[(i-1)/2-1];}
}
cout<<a[n];
}
2020-11-07 12:21:05
zuv bodolt nadaas huul
#include<stdio.h>
main(){
long long int i,a[10000],b,c,d,e;
scanf("%lld",&d);
a[0]=1;
a[1]=1;
for(int i=2;i<=d;i++)
{
if(i%2==0){a[i]=a[i/2]+a[i/2-1];}
else {a[i]=a[(i-1)/2]-a[(i-1)/2-1];}
}
printf("%lld",a[d]);
}
2019-11-09 05:46:35
#include<stdio.h>
main(){
int i,a[10000],n=9999999,b,c,d,e;
scanf("%d",&d);
a[0]=1;
a[1]=1;
for(int i=2;i<=d;i++)
{
if(i%2==0){a[i]=a[i/2]+a[i/2-1];}
else {a[i]=a[(i-1)/2]-a[(i-1)/2-1];}
}
printf("%d",a[d]);
}
2019-10-20 11:08:59
Tembuujin

q
2019-03-23 16:06:43



















































.





















.






.






.





.








.






.





.










.









.







.






.





ymar olon ym
















.








.






.










.





.






.




.







end bodlogo bhgvi ee
2019-03-11 09:53:15











































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































2018-03-05 08:39:11
#include<stdio.h>
main(){
int i,a[10000],n=9999999,b,c,d,e;
scanf("%d",&d);
a[0]=1;
a[1]=1;
for(int i=2;i<=d;i++)
{
if(i%2==0){a[i]=a[i/2]+a[i/2-1];}
else {a[i]=a[(i-1)/2]-a[(i-1)/2-1];}
}
printf("%d",a[d]);
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.