output_description: For each dataset, write a line that contains an expected value. You may print
  any number of digits after the decimal point. Answers that have an error less
  than 1.0e-2 will be accepted.
input_description: Input consists of several datasets.
  
  Input for a single dataset is given as a single integer _n_.
  
  Input terminates with a dataset where _n_ = 0.
attempt: code = """
  #include <bits/stdc++.h>
  using namespace std;
  
  #define dump(...) cout<<"# "<<#__VA_ARGS__<<'='<<(__VA_ARGS__)<<endl
  #define repi(i,a,b) for(int i=int(a);i<int(b);i++)
  #define peri(i,a,b) for(int i=int(b);i-->int(a);)
  #define rep(i,n) repi(i,0,n)
  #define per(i,n) peri(i,0,n)
  #define all(c) begin(c),end(c)
  #define mp make_pair
  #define mt make_tuple
  
  typedef unsigned int uint;
  typedef long long ll;
  typedef unsigned long long ull;
  typedef pair<int,int> pii;
  typedef vector<int> vi;
  typedef vector<vi> vvi;
  typedef vector<ll> vl;
  typedef vector<vl> vvl;
  typedef vector<double> vd;
  typedef vector<vd> vvd;
  typedef vector<string> vs;
  
  template<typename T1,typename T2>
  ostream& operator<<(ostream& os,const pair<T1,T2>& p){
  	return os<<'('<<p.first<<','<<p.second<<')';
  }
  
  template<typename Tuple>
  void print_tuple(ostream&,const Tuple&){}
  template<typename Car,typename... Cdr,typename Tuple>
  void print_tuple(ostream& os,const Tuple& t){
  	print_tuple<Cdr...>(os,t);
  	os<<(sizeof...(Cdr)?",":"")<<get<sizeof...(Cdr)>(t);
  }
  template<typename... Args>
  ostream& operator<<(ostream& os,const tuple<Args...>& t){
  	print_tuple<Args...>(os<<'(',t);
  	return os<<')';
  }
  
  template<typename Ch,typename Tr,typename C,typename=decltype(begin(C()))>
  basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
  	os<<'[';
  	for(auto i=begin(c);i!=end(c);++i)
  		os<<(i==begin(c)?"":" ")<<*i;
  	return os<<']';
  }
  
  constexpr int INF=1e9;
  constexpr int MOD=1e9+7;
  constexpr double EPS=1e-9;
  
  int main()
  {
  	for(int n;cin>>n && n;){
  		map<pii,double> dp;
  		dp[mp(0,0)]=1;
  		rep(_,n){
  			map<pii,double> dp2;
  			for(auto p:dp){
  				if(p.second<1e-6) continue;
  				int cnt,cur; tie(cnt,cur)=p.first;
  				dp2[mp(cnt+1,cur+1)]+=p.second*1./(1<<cur);
  				dp2[mp(cnt,0)]+=p.second*(1-1./(1<<cur));
  			}
  			swap(dp,dp2);
  		}
  		double res=0;
  		for(auto p:dp)
  			res+=p.first.first*p.second;
  		printf("%.8f",res); puts("");
  	}
  }
  """
  
  import os, tempfile
  
  (_, filename) = tempfile.mkstemp(".cpp")
  
  f = open(filename, "w")
  f.write(code)
  f.close()
  
  os.system("g++ -std=c++11 {} -o ./a.out".format(filename))
  os.system("./a.out")
  
problem_description: F: Ben Toh
  
  As usual, those who called wolves get together on 8 p.m. at the supermarket.
  The thing they want is only one, a box lunch that is labeled half price.
  Scrambling for a few discounted box lunch, they fiercely fight every day. And
  those who are blessed by hunger and appetite the best can acquire the box
  lunch, while others have to have cup ramen or something with tear in their
  eyes.
  
  A senior high school student, Sato, is one of wolves. A dormitry he lives
  doesn't serve a dinner, and his parents don't send so much money. Therefore he
  absolutely acquire the half-priced box lunch and save his money. Otherwise he
  have to give up comic books and video games, or begin part-time job.
  
  Since Sato is an excellent wolf, he can acquire the discounted box lunch in
  100% probability on the first day. But on the next day, many other wolves
  cooperate to block him and the probability to get a box lunch will be 50%.
  Even though he can get, the probability to get will be 25% on the next day of
  the day. Likewise, if he gets a box lunch on a certain day, the probability to
  get on the next day will be half. Once he failed to get a box lunch,
  probability to get would be back to 100%.
  
  He continue to go to supermaket and try to get the discounted box lunch for
  _n_ days. Please write a program to computes the expected value of the number
  of the discounted box lunches he can acquire.
samples: [{"input": "2\n    3\n    0", "output": ".00000000\n    1.50000000\n    2.12500000"}]