Can you see this solution?
Leetcode will shadowban my solution, so, can you see this solution?
Leetcode will shadowban my solution, so, can you see this solution? 

```rust []
impl Solution {
    pub fn max_distance(side: i32, points: Vec<Vec<i32>>, k: i32) -> i32 {
        fn md(points: &[Vec<i64>], i: i64, j: i64) -> i64 {
            (points[i as usize][0] - points[j as usize][0]).abs() + (points[i as usize][1] - points[j as usize][1]).abs()
        }

        fn get_next(points: &[Vec<i64>], i: i64, mid: i64) -> i64 {
            let n = points.len();
            let base = i as usize % n;
            let mut lo = i + 1;
            let mut hi = i + n as i64 - 1;
            while lo < hi {
                let m = ((lo + hi + 1) / 2) as usize;
                let d1 = (points[base][0] - points[(m - 1) % n][0]).abs() + (points[base][1] - points[(m - 1) % n][1]).abs();
                let d2 = (points[base][0] - points[m % n][0]).abs() + (points[base][1] - points[m % n][1]).abs();
                if d1 < d2 {
                    lo = m as i64;
                } else {
                    hi = m as i64 - 1;
                }
            }
            let peak = lo;
            let mut candidate1 = -1;
            let mut lo1 = i + 1;
            let mut hi1 = peak;
            while lo1 <= hi1 {
                let m = ((lo1 + hi1) / 2) as usize;
                let d = (points[base][0] - points[m % n][0]).abs() + (points[base][1] - points[m % n][1]).abs();
                if d >= mid {
                    candidate1 = m as i64;
                    hi1 = m as i64 - 1;
                } else {
                    lo1 = m as i64 + 1;
                }
            }
            let mut candidate2 = -1;
            let mut lo2 = peak;
            let mut hi2 = i + n as i64 - 1;
            while lo2 <= hi2 {
                let m = ((lo2 + hi2) / 2) as usize;
                let d = (points[base][0] - points[m % n][0]).abs() + (points[base][1] - points[m % n][1]).abs();
                if d >= mid {
                    candidate2 = m as i64;
                    hi2 = m as i64 - 1;
                } else {
                    lo2 = m as i64 + 1;
                }
            }
            if candidate1 == -1 && candidate2 == -1 {
                return -1;
            }
            if candidate1 == -1 {
                return candidate2;
            }
            if candidate2 == -1 {
                return candidate1;
            }
            if candidate1 < candidate2 {
                candidate1
            } else {
                candidate2
            }
        }

        fn can(points: &[Vec<i64>], n: i64, k: i64, mid: i64) -> bool {
            for i in 0..n {
                let mut cnt = 1;
                let mut cur = i;
                let mut valid = true;
                while cnt < k {
                    let nxt = get_next(points, cur, mid);
                    if nxt == -1 || nxt >= i + n {
                        valid = false;
                        break;
                    }
                    cur = nxt;
                    cnt += 1;
                }
                if valid && cnt == k && md(points, cur % n, i % n) >= mid {
                    return true;
                }
            }
            false
        }

        let n = points.len() as i64;
        let cx = side as f64 / 2.0;
        let cy = side as f64 / 2.0;
        let mut points: Vec<Vec<i64>> = points.iter().map(|v| v.iter().map(|&x| x as i64).collect()).collect();
        points.sort_by(|a, b| {
            let (a0, a1, b0, b1) = (a[0] as f64, a[1] as f64, b[0] as f64, b[1] as f64);
            (b1 - cy).atan2(b0 - cx).partial_cmp(&(a1 - cy).atan2(a0 - cx)).unwrap()
        });

        let mut lo_val = 0;
        let mut hi_val = 2 * side as i64;
        let mut ans = 0;
        while lo_val <= hi_val {
            let mid = (lo_val + hi_val) / 2;
            if can(&points, n, k as i64, mid) {
                ans = mid;
                lo_val = mid + 1;
            } else {
                hi_val = mid - 1;
            }
        }

        ans as i32
    }
}

```
['Rust']