use proconio::input; fn main() { input! { times: [i32; 7] } let mut rem: i32 = 6000; for time in times { rem -= time; let ans = if rem >= 0 { rem } else { -1 }; println!("{}", ans); } }