CF216C.Hiring Staff

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

A new Berland businessman Vitaly is going to open a household appliances' store. All he's got to do now is to hire the staff.

The store will work seven days a week, but not around the clock. Every day at least kk people must work in the store.

Berland has a law that determines the order of working days and non-working days. Namely, each employee must work for exactly nn consecutive days, then rest for exactly mm days, then work for nn more days and rest for mm more, and so on. Vitaly doesn't want to break the law. Fortunately, there is a loophole: the law comes into force on the day when the employee is hired. For example, if an employee is hired on day xx , then he should work on days [x,x+1,...,x+n1][x,x+1,...,x+n-1] , [x+m+n,x+m+n+1,...,x+m+2n1][x+m+n,x+m+n+1,...,x+m+2n-1] , and so on. Day xx can be chosen arbitrarily by Vitaly.

There is one more thing: the key to the store. Berland law prohibits making copies of keys, so there is only one key. Vitaly is planning to entrust the key to the store employees. At the same time on each day the key must be with an employee who works that day — otherwise on this day no one can get inside the store. During the day the key holder can give the key to another employee, if he also works that day. The key will handed to the first hired employee at his first working day.

Each employee has to be paid salary. Therefore, Vitaly wants to hire as few employees as possible provided that the store can operate normally on each day from 11 to infinity. In other words, on each day with index from 11 to infinity, the store must have at least kk working employees, and one of the working employees should have the key to the store.

Help Vitaly and determine the minimum required number of employees, as well as days on which they should be hired.

输入格式

The first line contains three integers nn , mm and kk ( 1<=m<=n<=10001<=m<=n<=1000 , n1n≠1 , 1<=k<=10001<=k<=1000 ).

输出格式

In the first line print a single integer zz — the minimum required number of employees.

In the second line print zz positive integers, separated by spaces: the ii -th integer aia_{i} ( 1<=ai<=1041<=a_{i}<=10^{4} ) should represent the number of the day, on which Vitaly should hire the ii -th employee.

If there are multiple answers, print any of them.

输入输出样例

  • 输入#1

    4 3 2
    

    输出#1

    4
    1 1 4 5
  • 输入#2

    3 3 1
    

    输出#2

    3
    1 3 5
首页