题库练习 Cron
← 上一题 下一题 →

A10538 | Cron

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

The first line of the input contains six integers $s$ , $m$ , $h$ , $day$ , $date$ and $month$ ( $0<=s,m<=59$ , $0<=h<=23$ , $1<=day<=7$ , $1<=date<=31$ , $1<=month<=12$ ). Each of the number can also be equal to $-1$ . It's guaranteed, that there are infinitely many moments of time when this task should be executed.

Next line contains the only integer $n$ ( $1<=n<=1000$ ) — the number of moments of time you have to solve the problem for. Each of the next $n$ lines contains a single integer $t_{i}$ ( $0<=t_{i}<=10^{12}$ ).

输入格式

Print $n$ lines, the $i$ -th of them should contain the first moment of time strictly greater than $t_{i}$ , when the task should be executed.

输出格式

The moment of time $1467372658$ after the midnight of January 1st, 1970 is 11:30:58 July 1st, 2016.

输入输出样例

输入 #1
-1 59 23 -1 -1 -1
6
1467372658
1467417540
1467417541
1467417598
1467417599
1467417600
输出 #1
1467417540
1467417541
1467417542
1467417599
1467503940
1467503940
输入 #2
0 0 12 6 3 7
3
1467372658
1467460810
1467547200
输出 #2
1467460800
1467547200
1468065600
C++ 编辑器
输入
输出