#include #include #include #include #include #include using namespace std; const long long MOVEUP = 1e10; int main() { int n; string s; long long num1, num2; long long ans1 = 0, ans2 = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> s; int pos = s.find('.'); if (pos == string::npos) { num1 = stoll(s); num2 = 0; } else { num1 = stoll(s.substr(0, pos)); num2 = stoll(s.append(10, '0').substr(pos + 1, 10)); } // printf("%30s %10lld.%10lld\n", s.c_str(), num1, num2); ans1 += num1; ans2 += (s[0] == '-') ? -num2 : num2; if (ans2 < 0) { ans1--; ans2 += MOVEUP; } else if (ans2 >= MOVEUP) { ans1++; ans2 -= MOVEUP; } } if (ans1 >= 0) { printf("%lld.%010lld\n", ans1, ans2); } else if (ans1 == -1) { printf("-0.%010lld\n", abs(ans2 - MOVEUP)); } else { printf("%lld.%010lld\n", ans1 + 1, abs(ans2 - MOVEUP)); } return 0; }