atcoder#AGC053A. [AGC053A] >< again
[AGC053A] >< again
Score : points
Problem Statement
We have a string of length , where each character is <
or >
.
A non-negative integer sequence of elements, , is said to be good when it satisfies the following for every :
- S_i$ is
<
; - , if is
>
.
Given a good non-negative integer sequence , divide it into as many good non-negative integer sequences as possible. That is, find a positive integer and good non-negative integer sequences satisfying the following with the maximum possible value of :
- For every , the sum of the -th elements of equals .
Constraints
- is a string of length consisting of
<
and>
. - is a good non-negative integer sequence. Particularly, has elements.
Input
Input is given from Standard Input in the following format:
Output
Print your answer to Standard Output in the following format:
Here, denotes the value of the -th element of the good non-negative integer sequence .
3
<><
3 8 6 10
2
1 5 4 7
2 3 2 3