Let's take n points numbered from 1 to n, placed in order on a circle. Initially the points are colored in black. We have to color in red k of these n points, so that no two nearby red points exist.
Task
Determine in how many ways we can color k of the n points so that no two nearby red points exist.
Input Data
Input file red.in contains on the first line the positive integers n and k, separated by a space.
Output Data
Output file red.out will contain a single line with the determined number of ways.
Constraints
red.in | red.out | Explanation |
4 2 |
2 |
The two coloring ways are: |
red.in | red.out | Explanation |
5 2 |
5 |
The five coloring ways are: |
Time limit: 0.1 seconds/test
prof. Marinel Serban
"Grigore Moisil" Iaşi IT High School
Contact:marinel_serban@yahoo.com