using System.Collections.Generic;
public static class Program
public static void Main()
var result = new Ray().solution(new Point2D[] {
new Point2D { x = -1, y = -2 },
new Point2D { x = 1, y = 2 },
new Point2D { x = 2, y = 4 }
Console.WriteLine(result);
public int solution(Point2D[] A) {
double[] slopes = new double[A.Length];
int[] regions = new int[A.Length];
for(int i=0;i<A.Length;i++) {
slopes[i] = Double.PositiveInfinity;
slopes[i] = Double.NegativeInfinity;
slopes[i] = A[i].y/A[i].x;
if(A[i].x>=0 && A[i].y>0)
if(A[i].x<0 && A[i].y>=0)
if(A[i].x<=0 && A[i].y<0)
if(A[i].x>0 && A[i].y<=0)
HashSet<String> uniqueSet = new HashSet<String>();
for(int i=0;i<regions.Length;i++) {
uniqueSet.Add(slopes[i]+"-"+regions[i]);