#include #define rep(i,a,b) for(int i=int(a);i> N; rep(i,0,N){ string s; cin >> s; int ind = charsearch(s,'.'); ll a,b; if(ind != -1){ //cout << s.substr(0,ind) << endl; //cout << s.substr(ind+1) << endl; a = stoll(s.substr(0,ind)); b = stoll(s.substr(ind+1) + string(9 - (s.size() - ind - 1), '0') ); //cout << a << " " << b << endl; }else{ a = stoll(s); b = 0; } int sign2 = s[0] == '-' ? -1 : 1; a = abs(a); if(sign == sign2){ num[1] += b; num[0] += a + (num[1] / MOD); num[1] %= MOD; }else{ if(num[0] < a || num[0] == a && num[1] < b){ swap(num[0], a); swap(num[1], b); sign = sign2; } num[1] -= b; if(num[1] < 0){ num[0]--; num[1] += MOD; } num[0] -= a; } } num[0] *= sign; printf("%lld.%010lld", num[0], num[1]); }