# frozen_string_literal: true class Array def count_points(left, right) 2 + (0..N - 1) .reject { _1 == left || _1 == right } .count { (self[left][0] - self[right][0]) * (self[_1][1] - self[left][1]) == (self[left][1] - self[right][1]) * (self[_1][0] - self[left][0]) } end end def solve (0..N - 2).map do |left| (left + 1..N - 1).map do |right| XY.count_points(left, right) end end.flatten.max end N = gets.to_i XY = N.times.map { gets.split.map(&:to_i) } puts solve