301159: CF216C. Hiring Staff

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Hiring Staff

题意翻译

## 描述: 有一个大型超市需要雇佣员工,若在第 x 天雇佣一个员工,则该员工会连续工作 n 天,然后休息 m 天,重复以上规律。要求每天至少要有 k 个员工在超市上班,并且至少有一个员工是来自前一天工作的。输出最少需要雇佣的员工数量和每个员是在第几天开始雇佣的,例如 d[i]=j 表示第 i 个员工是在第 j 天开始雇佣的。 ## 输入描述: 输入第一行包含三个整数 n , m 和 k ( 1≤m≤n≤1000 , n=1 , 1≤k≤1000)。 ## 输出描述: 在第一行输出一个整数 z 表示所需的最少员工人数。 在第二行打印 z 个正整数,用空格分隔: 第 i 个整数 a i ​ ( 1≤a i ​ ≤10 4 ) 应该表示应聘用第 i 名员工的日期。 如果有多个答案,请输出其中任何一个。

题目描述

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 $ k $ 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 $ n $ consecutive days, then rest for exactly $ m $ days, then work for $ n $ more days and rest for $ m $ 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 $ x $ , then he should work on days $ [x,x+1,...,x+n-1] $ , $ [x+m+n,x+m+n+1,...,x+m+2n-1] $ , and so on. Day $ x $ 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 $ 1 $ to infinity. In other words, on each day with index from $ 1 $ to infinity, the store must have at least $ k $ 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 $ n $ , $ m $ and $ k $ ( $ 1<=m<=n<=1000 $ , $ n≠1 $ , $ 1<=k<=1000 $ ).

输出格式


In the first line print a single integer $ z $ — the minimum required number of employees. In the second line print $ z $ positive integers, separated by spaces: the $ i $ -th integer $ a_{i} $ ( $ 1<=a_{i}<=10^{4} $ ) should represent the number of the day, on which Vitaly should hire the $ i $ -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

Input

题意翻译

## 描述: 有一个大型超市需要雇佣员工,若在第 x 天雇佣一个员工,则该员工会连续工作 n 天,然后休息 m 天,重复以上规律。要求每天至少要有 k 个员工在超市上班,并且至少有一个员工是来自前一天工作的。输出最少需要雇佣的员工数量和每个员是在第几天开始雇佣的,例如 d[i]=j 表示第 i 个员工是在第 j 天开始雇佣的。 ## 输入描述: 输入第一行包含三个整数 n , m 和 k ( 1≤m≤n≤1000 , n=1 , 1≤k≤1000)。 ## 输出描述: 在第一行输出一个整数 z 表示所需的最少员工人数。 在第二行打印 z 个正整数,用空格分隔: 第 i 个整数 a i ​ ( 1≤a i ​ ≤10 4 ) 应该表示应聘用第 i 名员工的日期。 如果有多个答案,请输出其中任何一个。

加入题单

算法标签: