int Solution::fibsum(int A) {
vector<int> fib;
int a = 0, b = 1, c;
int res = 0;
while(c <= A){
c = a + b;
a = b;
b = c;
fib.push_back(c);
}
int n = fib.size();
for(int i = n - 1; i >= 0 && A > 0; i--){
while(A >= fib[i]){
res++;
A -= fib[i];
}
}
return res;
}
run this code you will find it