P27840 [洛谷] [Language Contest 202305] Solitary Journey
普及
题目描述

Problem Background

Solitary Journey

Alone in a wooden boat,
Heart heavy, spirit uneasy.
Beloved a thousand miles away,
Thoughts steadfast, unwavering.

Written by zyl on March 28, 2023, and dedicated to the girl he admires.

Problem Description

zyl is a third-year junior high school OIer.

zyl had no time or opportunity to study OI in his hometown. One day, he received an invitation from another school. To pursue his dream, he agreed and chose to travel by boat.

However, since he was going alone, he often found himself missing her in the classroom.

zyl set off at midnight on April 1, 2023, to reach a destination $S\text{ m}$ away from his hometown. His boat speed towards the destination is $v_{0}\text{ m/s}$. On the journey, he continuously misses her and each time he turns the boat around, hoping to return and spend time with her. He misses her a total of $n(1\le n \le 100)$ times, with the $i$-th time starting after he has traveled for $T_{i}$ seconds.

During the first instance of missing her, he spends $t_{1}$ seconds traveling back to his hometown at a speed of $v_{1}\text{ m/s}$. Each subsequent time, zyl's thoughts deepen, increasing his speed by $v_{2}\text{ m/s}$ and the duration by $t_{2}$ seconds.

However, if zyl has already reached the destination, he will simply stand still, gazing towards his hometown... After each instance of missing her, zyl resumes traveling towards the destination at the initial speed. Once he reaches the destination, he stops.

If he returns to his hometown during his thoughts, he will spend the remaining time of his thoughts playing chess with her, as they both enjoyed playing chess together.

(However, in reality, he thinks about her every moment.)

He doesn't have a watch and wants to know at what date and time he will arrive at the destination. Since he needs to attend classes, he will definitely arrive before April 30, 2023, at 23:59:59.

Input and Output Formats

Input Format

Three lines in total.

The first line contains six integers $S$, $v_{0}$, $v_{1}$, $t_{1}$, $v_{2}$, $t_{2}$, separated by spaces. Their meanings are as described in the problem.

The second line contains one integer $n$.

The third line contains $n$ integers, the $i$-th being $T_{i}$, separated by spaces.

Output Format

One line containing a string in the format 202304xxatxx:xx:xx, where x represents the corresponding time characters. Note that if the day, hour, minute, or second is a single digit, a 0 should be prepended.

If the arrival time is not an integer number of seconds, it should be rounded up. For example, if arriving at 1.1 seconds, it should be recorded as 2 seconds.

Sample Input and Output

Sample Input #1

20 4 2 2 2 1
2 
2 7

Sample Output #1

20230401at00:00:14

Sample Input #2

2000 2 4 10 3 2
5
5 20 40 60 20080626

Sample Output #2

20230401at00:17:56

Notes

All input data are integers.

For 40% of the data, $v_{2}=t_{2}=0$;

For another 20% of the data, $n=1$;

For 100% of the data, $1\leqslant n \leqslant 100$, $1\leqslant S \leqslant 2\times10^{9}$, $1\leqslant v_{0} \leqslant S$, $1\leqslant v_{1},t_{1} \leqslant 500$, $0\leqslant v_{2},t_{2} \leqslant 50$, $0\leqslant T_{i} \leqslant 20080626$. It is guaranteed that $T$ is monotonically increasing and that no two instances of missing her overlap. It is also guaranteed that the arrival time will be within April. The data does not guarantee that zyl will not miss her after reaching the destination.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
20 4 2 2 2 1 2 2 7
样例输出
20230401at00:00:14