#include <bits/stdc++.h>
using namespace std;
int main(){
double res=0.0; //累加和
double temp; //项
int index=2; //当前项下标
temp=1.0/2.0; //计算1/2!
res=2+temp; //前三项和(1+1/1!+1/2!)
while(temp>1e-5){ //小于给定范围则终止
index++;
temp/=index;
res+=temp;
}
//注意当前项下标与项数差1
cout<<fixed<<setprecision(5)<<res<<" "<<index+1;
}