Just a runnable solution
\n\nimpl Solution {\n    pub fn maximum_value_sum(nums: Vec<i32>, k: i32, _edges: Vec<Vec<i32>>) -> i64 {\n        let nums: Vec<i64> = nums.iter().map(|&x| x a
\n```\nimpl Solution {\n    pub fn maximum_value_sum(nums: Vec<i32>, k: i32, _edges: Vec<Vec<i32>>) -> i64 {\n        let nums: Vec<i64> = nums.iter().map(|&x| x as i64).collect();\n        let k = k as i64;\n        let mut sum = 0;\n        let mut cnt = 0;\n        let mut sacrifice = i64::MAX;\n        for &n in nums.iter() {\n            let tmp = n ^ k;\n            sum += tmp.max(n);\n            cnt += if tmp > n { 1 } else { 0 };\n            sacrifice = sacrifice.min((n - tmp).abs());\n        }\n        sum - if cnt % 2 == 1 { sacrifice } else { 0 }\n    }\n}\n\n```
['Rust']