struct Solution; impl Solution { pub fn maximum_or(nums: Vec, k: i32) -> i64 { let n = nums.len(); let k = k as i64; let mut pa = vec![0;n+1]; for i in 1..=n { pa[i] = pa[i-1] | nums[i-1] as i64; } let mut sa = vec![0;n+1]; for i in (0..n).rev() { sa[i] = sa[i+1] | nums[i] as i64; } (0..n).fold(0, |res, i|res.max((nums[i] as i64) < = buf.trim().split(' ').map(|x|x.parse::().unwrap()).collect::>(); buf.clear(); std::io::stdin().read_line(&mut buf).ok(); let k: i32 = buf.trim().parse::().unwrap(); println!("{}", Solution::maximum_or(nums, k)); }