#include<iostream> using namespace std; int main(){ double begin; cin>>begin; double path=begin; double fiveH=begin; for(int i=0;i<5;i++){ fiveH/=2; if(i<4) path+=fiveH*2; } printf("%.6f\n%.6f",path,fiveH); system("pause"); }
#include<iostream> using namespace std; int main(){ double begin; cin>>begin; double path=begin; double fiveH=begin; for(int i=0;i<5;i++){ fiveH/=2; if(i<4) path+=fiveH*2; } printf("%.6f\n%.6f",path,fiveH); system("pause"); }