문제
Problem 3: Decorating The Pastures [Kalki Seksaria, 2014]
Farmer John has N
입력
* Line 1: Two integers N and M.
* Lines 2..M+1: Two integers,
출력
* Line 1:
A single integer indicating the maximum number of 'J' signs that Bessie can use. If there is no valid solution for arranging the signs, output -1.
예제1
4 4
1 2
2 3
3 4
4 1
2
Input Details
The pastures and paths form the vertices and edges of a square.
Output Details
Bessie can either choose to label pastures 1 and 3 with 'J' signs, or alternatively pastures 2 and 4.