Problema 2:
#include <iostream>
#include <cmath>
using namespace std;
float A[1001],B[1001];
int a,b,n,i;
int main()
{cin>>a>>b>>n;
A[0]=a;
B[0]=b;
for(i=1;i<=n;i++)
A[i]=(A[i-1]+B[i-1])/2;
for(i=1;i<=n;i++)
B[i]=sqrt(A[i-1]*B[i-1]);
cout<<A[n]<<" "<<B[n];
return 0;
}