#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; bool compare(const double a, const double b) { return fabs(a) < fabs(b); } int main() { int n; cin >> n; long double a[n], b[n]; long double ans = 0; for (int i = 0; i < n; i++) { long double x; cin >> x; b[i] = modf(x, &a[i]); ans += x; } cout << fixed << setprecision(10) << ans << endl; sort(a, a+n); sort(b, b+n, compare); long double sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0; for (int i = 0; i < n; i++) { sum1 += a[i]; sum2 += b[i]; } // cout << fixed << setprecision(10) << ((sum1+sum3)+sum2+sum4) << endl; }