using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
var result = new Ray().solution(new Point2D[] {
new Point2D { x = -1, y = -2 },
new Point2D { x = 1, y = 2 },
Console.WriteLine(result);
public int solution(Point2D[] A)
HashSet<decimal> raysDegrees = new HashSet<decimal>();
Parallel.ForEach<Point2D>(A, (point) =>
decimal rayDegree = RayDegree(point);
raysDegrees.Add(rayDegree);
return raysDegrees.Count();
static decimal RayDegree(Point2D p) => Decimal.Divide(p.x, p.y);