문제
Bessie has a string of length
Bessie thinks the string will look better if it contains more moos of length
For each positive integer
입력
The first line contains
The next line contains Bessie's length-
The next line contains space-separated integers
출력
Output
부분문제
번호 | 점수 | 조건 |
---|---|---|
#1 | 10점 | |
#2 | 20점 | |
#3 | 30점 | |
#4 | 40점 | |
예제1
14
MOOO
10 20 30 40
0
20
50
90
예제2
34
OOOO
50 40 30 20
40
예제3
220
OOOMOMOOOMOOOMMMOMOO
44743602 39649528 94028117 50811780 97338107 30426846 94909807 22669835 78498782 18004278 16633124 24711234 90542888 88490759 12851185 74589289 54413775 21184626 97688928 10497142
0
0
0
0
0
12851185
35521020
60232254
99881782
952304708
예제4
320
OOOMOMOOOMOOOMMMOMOO
44743602 39649528 94028117 50811780 97338107 30426846 94909807 22669835 78498782 18004278 16633124 24711234 90542888 88490759 12851185 74589289 54413775 21184626 97688928 10497142
0
0
0
44743602
119332891
207066974