use proconio::input; fn main(){ input!{ t: usize, } for _ in 0..t{ input!{ n: usize, f: [usize; n], } println!("{}", f.iter().filter(|&&x| x == 1).count()); } }