use std::collections::{HashMap, HashSet}; use proconio::marker::Chars; fn main() { proconio::input! { n: u32, mut a: [String;n], } let a = a .into_iter() .map(|s| { let s = s.split('.').collect::>(); if s.len() == 1 { [ s[0].parse::().unwrap() + 1, -10000000000, ] } else { [ s[0].parse::().unwrap(), s[1].parse::().unwrap() * (10i128).pow(10 - s[1].len() as u32) * if s[0].starts_with('-') { -1 } else { 1 }, ] } }) .collect::>(); for a in a.iter() { eprintln!("{a:?}"); } let x = a.iter().map(|x| x[0]).sum::(); let y = a.iter().map(|x| x[1]).sum::(); let x = x + y / 10000000000; let y = y % 10000000000; println!("{}.{:010}", x, y.abs()); }