#include <stdio.h> #include<math.h> int main() { int m,n,i; double x; double y; scanf("%d%d",&m,&n); x=m; y=m*(-1); for(i=1;i<=n;i++) { y=2*x+y; x=x/2; } printf("%.2f %.2f",x,y); return 0; }
Double click to view unformatted code.