fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect() } fn main() { let n: usize = read(); let ps = (0..n).map(|_| { let input:Vec = read_vec(); (input[0], input[1]) }).collect::>(); println!("{}", no1041(ps)); } fn no1041(ps:Vec<(usize,usize)>) -> usize { let in_line = |(x1,y1):&(usize,usize),(x2,y2):&(usize,usize),(x3,y3):&(usize,usize)| -> bool { let x1 = *x1 as f64; let y1 = *y1 as f64; let x2 = *x2 as f64; let y2 = *y2 as f64; let x3 = *x3 as f64; let y3 = *y3 as f64; if x2-x1 == 0.0 && x3-x1 == 0.0 || y2-y1 == 0.0 && y3-y1 == 0.0 { true } else if x2-x1 != 0.0 && x3-x1 != 0.0 { (y2-y1)/(x2-x1) == (y3-y1)/(x3-x1) } else { false } }; let mut counter:Vec> = vec![vec![2;ps.len()];ps.len()]; for i in 0..ps.len()-2 { for j in i+1..ps.len()-1 { counter[i][j] = 2; for k in j+1..ps.len() { if in_line(&ps[i],&ps[j],&ps[k]) { counter[i][j] += 1; } } } } let mut max = 0; for a in counter { for b in a { if b > max { max = b; } } } max }