Miku

暴力出奇迹,打表拿省一


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int a[30]={0,1,1,2,2,3,4,6,9,14,22,35,56,90,145,234,378,611,988,1598,2585};
int b[30]={0,0,0,0,1,2,4,7,12,20,33,54,88,143,232,376,609,986,1596,2583,4180};
int aa,n,m,x;
int bb;
int main(){
	scanf("%d%d%d%d",&aa,&n,&m,&x);
	n--;
//	cout<<a[n]<<" "<<b[n]<<endl;
	bb=(m-a[n]*aa)/b[n];
	cout<<a[x]*aa+b[x]*bb; 
	return 0;
}

相关文章:

  • 2021-11-12
  • 2022-02-24
  • 2021-10-26
  • 2022-03-08
  • 2021-11-12
  • 2021-10-01
猜你喜欢
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-12-13
  • 2022-12-23
相关资源
相似解决方案