human
I found an interesting problem on https://www.codechef.com/problems/LIGHTHSE:
There are N islands in the sea, enumerated from 1 to N. Each of them is so small that we can consider them as points on a plane. You are given the Cartesian coordinates of all islands. X-axis is directed towards East and Y-axis is directed towards North.
You need to illuminate all the islands. To do this, you can place lighthouses on some of the islands. You can't place more than one lighthouse on any single island. Each lighthouse can light only one of the 4 quadrants: North-Western, North-Eastern, South-Western or South-Eastern. If some island is located on the border of an illuminated quadrant, it is considered to be illuminated as well. Note that this means that a lighthouse always illuminates it's own island as well.
Find the smallest possible number of lighthouses required to illuminate all the islands (say L). Describe their configurations — positions and quadrants illuminated — as well.

-----Input-----
The first line of input contains an integer T denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains a single integer N denoting the number of islands.
The ith of the following N lines contains two integers Xi and Yi denoting the coordinates of the ith island.

-----Output-----
For each test case, first line of output must contain minimum number of lighthouses required to illuminate all islands, L.
Following L lines must describe configuration of the lighthouses, one configuration per line. Description of a lighthouse configuration consists of the number of the island where the lighthouse is placed, and the direction of the quadrant (NW for North-Western, NE for North-Eastern, SW for South-Western, SE for South-Eastern) illuminated by it, separated by a single space.
If there are many possible placements, output any one of them.

-----Constraints-----
- 1 ≤ T ≤ 1000
- 1 ≤ N ≤ 105
- The sum of N over all test cases doesn't exceed 5*105
- Absolute value of each coordinate doesn't exceed 109
- No two given islands...

I tried it in Python, but could not do it. Can you solve it?

 Can you provide a Python program to find the smallest possible number of lighthouses required to illuminate all the islands (say L)?
assistant
#Here is Python program to find the smallest possible number of lighthouses required to illuminate all the islands (say L).

class island:
 'number, x, y' 
 def __init__(self,x,y,number):
  self.x = x
  self.y = y
  self.number = number

def lighthouses(islands):
 low = high = left = right = islands[0]

 left = min(islands, key = lambda a : a.x)
 right= max(islands, key = lambda a : a.x)
 low = min(islands, key = lambda a : a.y)
 high = max(islands, key = lambda a : a.y)

 if left == low:
  print(1)
  print(str(left.number) + ' NE')
 elif left == high:
  print(1)
  print(str(left.number) + ' SE')
 elif right == low:
  print(1)
  print(str(right.number) + ' NW')
 elif right == high:
  print(1)
  print(str(right.number) + ' SW')
 else:
  islands.remove(left)
  nextleft = min(islands, key = lambda a : a.x)
   
  if left.y < nextleft.y:
   print(2)
   print(str(left.number) + ' NE')
   print(str(nextleft.number) + ' SE')
  else:
   print(2)
   print(str(left.number) + ' SE')
   print(str(nextleft.number) + ' NE')

T = int(input())
for i in range(T):
 N = int(input())
 islands = []
 for j in range(N):
  x, y = list(map(int, input().split()))
  islands.append(island(x,y,j+1))
 lighthouses(islands)