Baltic Olympiad in Informatics: 2017 Day 2, Problem 3
A cat lives in a tree that has
Input Specification
First line has two integers,
Constraints
We always have
- Group 1: 11 points
- Group 2: 40 points
- Group 3: 49 points No further restrictions.
Output Specification
Output should contain one integer: the maximum number of nodes that can be marked.
Sample Input 1
Copy
4 3
0
0
1
Sample Output 1
Copy
2
Sample Input 2
Copy
3 1000
0
0
Sample Output 2
Copy
1
Comments