{"problem":{"name":">< again","description":{"content":"We have a string $S$ of length $N$, where each character is `<` or `>`. A non-negative integer sequence of $N+1$ elements, $X_0,X_1,\\ldots,X_N$, is said to be _good_ when it satisfies the following fo","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc053_a"},"statements":[{"statement_type":"Markdown","content":"We have a string $S$ of length $N$, where each character is `<` or `>`.\nA non-negative integer sequence of $N+1$ elements, $X_0,X_1,\\ldots,X_N$, is said to be _good_ when it satisfies the following for every $1 \\leq i \\leq N$:\n\n*   $X_{i-1}<X_i$, if $S_i$ is `<`;\n*   $X_{i-1}>X_i$, if $S_i$ is `>`.\n\nGiven a good non-negative integer sequence $A$, divide it into as many good non-negative integer sequences as possible. That is, find a positive integer $k$ and $k$ good non-negative integer sequences $B_1,B_2,\\ldots, B_k$ satisfying the following with the maximum possible value of $k$:\n\n*   For every $0 \\leq i \\leq N$, the sum of the $i$\\-th elements of $B_1,\\ldots,B_k$ equals $A_i$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 100$\n*   $0 \\leq A_i \\leq 10^4$\n*   $S$ is a string of length $N$ consisting of `<` and `>`.\n*   $A$ is a good non-negative integer sequence. Particularly, $A$ has $N+1$ elements.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S$\n$A_0$ $A_1$ $\\cdots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc053_a","tags":[],"sample_group":[["3\n<><\n3 8 6 10","2\n1 5 4 7\n2 3 2 3"]],"created_at":"2026-03-03 11:01:14"}}