fork(38) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. double cur = 1.0 / 4;
  7. int x;
  8. double ans = 0;
  9. while (cin >> x)
  10. {
  11. ans += cur * x;
  12. cur *= 3.0 / 4;
  13. }
  14. cout << ans << endl;
  15. }
  16.  
Success #stdin #stdout 0s 2900KB
stdin
2340
1706
1614
1355
stdout
1274.75