#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,s,d,f,k;
cin>>a>>s>>d>>f;
int l;
k=a+s;
l=k+k;
for(int i=4;i<=f;i++)
{
a=s;
s=k;
k=a+s;
l=k+l;
if(k>d)
{
break;
}
}
cout<<l;
return 0;
}

0 条评论

目前还没有评论...

信息

ID
1000
难度
7
分类
(无)
标签
递交数
1594
已通过
303
通过率
19%
被复制
30
上传者