-->
当前位置:首页 > 题库

PROGRAMMING:Yooq and Charlotte

Luz5年前 (2021-05-10)题库494
As we all know, $$yooq $$is so bold that when his teammates are training hard in the computer room, he stays in the dormitory alone and happily watches the cartoon Charlotte. This completely angered the $$LC $$who was a second spiny salamander but trained hard and didn't go to watch animation. So one day at the time of $$HH: mm $$, $$LC $$shut $$yooq $$in the computer room and asked him to brush a set of training problems with a total of $$n (1 < = n < = 15) $. He was not allowed to watch Charlotte until he finished. It is known that each problem has a corresponding difficulty of $$I (1 < = I < = 5) $$, and it takes $$t for $$yooq $$to solve a problem with difficulty of $$I $$_ I want to know when he can finish the problem set, and then go to see his favorite friend, helinaixu. But his math is not very good, and he hasn't worked it out for a long time. Can you help him?
###Input format:
In the first line, give a positive integer $$n $, which means that there are a total of $$n $$questions, and a time $$HH: mm $$, which represents the time when the questions are started.
Next line, give $$n $$integers $$a_ 1,a_ 2......a_ n$$ ,$$a_ I $$represents the difficulty of question $$I $$$( 1<=a_ i<=5)$$
The last line gives five integers $$t_ 1,T_ 2,T_ 3,T_ 4,T_ 5$$ ,$$T_ I $$represents the time taken to solve a problem with difficulty of $$I $$$( T_ 1Input data to ensure that the start time is a legal time of $$24 $$hours, and the total time spent brushing the set of questions will not exceed $$1440 $$minutes (after all, $$LC $$is not a devil).
###Output format:
Output a moment in a row in the format of $$HH: mm $, which represents the moment when $$yooq $$finishes the problem set.
Note that both hours and minutes should be output in two digits. For example, at 1:01, please output $$01:01 $.
###Input example:
```in
7 18:00
1 2 5 3 4 5 1
1 2 3 4 5
```
###Output example:
```out
18:21
```







answer:If there is no answer, please comment