#P1756. Illuminations

Illuminations

题目描述

You are given a convex polygon with nnn vertices and mmm different points strictly outside the polygon which are all legal positions to install illuminants.

An illuminant can light up some exterior boundaries of the polygon. Your task is to install the least number of illuminants to light up all exterior boundaries of the polygon and provide a feasible scheme.

输入格式

输出格式

If it is impossible to light up all exterior boundaries of the polygon, output a single line with a single integer −1.

Otherwise output two lines. Firstly, output a line with a single integer k, representing the least number of illuminants needed to light up all the boundaries. Then, output a line with k space-separated distinct integers, describing a feasible scheme, each of which is the index of a selected position.

All feasible schemes are allowed, so you can output any of them.

样例

3 3 
0 0 
1 0 
0 1 
-1 -1 
3 -1 
-1 3
2 
2 1
3 1 
0 0 
1 0 
0 1 
-1 -1
-1

提示

by 艾拉拉