#include<stdio.h>int a, x;intOnBus(int n){if(n>2)returnOnBus(n-1)+OnBus(n-2);//斐波那契式递归:不是从前加到后,而应是由后返回前的思路!!!elseif(n==1)return a;elsereturn x;}intBusNum(int n){if(n>2)returnBusNum(n-1)+OnBus(n-2);elsereturn a;}intmain(void){int n, m, b;scanf("%d%d%d%d",&a,&n,&m,&b);for(x=1; x<100; x++){if(BusNum(n-1)==m){printf("%d\n",BusNum(b));return0;}}}